Reputation: 21
After successfully installing the tagfile gem, I try to include it using
require 'tagfile'
and see this error:
cannot load such file -- tagfile
I think that this may have to do with ruby running in a different environment than my gem command. It looks like gem uses
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
whereas ruby is in /bin/ruby
Upvotes: 0
Views: 65
Reputation: 59691
My current approach for this:
$ which gem
/usr/bin/gem
$ less /usr/bin/gem
Now look at the first line. That's the ruby interpreter gem
is using, and will install your gems in a way so that only this version of the interpreter will find them.
You can either:
gem
command is using. gem
as your default interpreter. Usually gem
is a symbolic link to gem1.9.3
, gem2.0
, gem2.1
etc so you can
substitute one of those commands with the version suffixed instead.Upvotes: 1