Reputation: 52580
Macs seem to all come with ruby 1.8.7 pre-installed. That's fine for my purposes, but when I install gems with either gem install gem-name
or sudo gem install gem-name
, I have to explicitly add the gem's lib directory to my $LOAD_PATH at the top of my ruby programs:
$LOAD_PATH.unshift File.join("/", "Users", "me", ".gems", "more_dirs", "lib")
Why do I have to do this? Am I installing gems wrong?
If I then install rvm and the latest ruby 1.9.3, I can install gems no problem with gem install gem-name
.
Upvotes: 1
Views: 3226
Reputation: 20232
With 1.8.7 where rubygems aren't built in. You need to
require 'rubygems'
at the top of your scripts in order to avoid manually setting the paths to your gems (pulling this in from the comments)
Upvotes: 1