Ruby 1.9.1 load path craziness!

Ok, I've just spent the 4 hours trying to figure this one out without
success. I've tried all the usual suspects and googled every combination of
ruby 1.9.1, load path, gems, mac os x,freebsd,prawn and other stuff. The
bottom line is this:

When I compile ruby1.9.1-p129 from sources on mac os x 10.5, the default
load path ($:) I get is:

ruby -e "puts $:" /usr/local/lib/ruby/gems
/usr/local/lib/ruby/site_ruby/1.9.1
/usr/local/lib/ruby/site_ruby/1.9.1/i386-darwin9.7.0
/usr/local/lib/ruby/site_ruby /usr/local/lib/ruby/vendor_ruby/1.9.1
/usr/local/lib/ruby/vendor_ruby/1.9.1/i386-darwin9.7.0
/usr/local/lib/ruby/vendor_ruby /usr/local/lib/ruby/1.9.1
/usr/local/lib/ruby/1.9.1/i386-darwin9.7.0 .

when I install the prawn gem, for example, I get:

gem which prawn (checking gem prawn-0.5.0.1 for prawn)

(checking gem prawn-0.5.0.1 for prawn)

/usr/local/lib/ruby/gems/1.9.1/gems/prawn-0.5.0.1/lib/prawn.rb

and when I try to require it I get:

ruby -e "require 'prawn'" -e:1:in require': no such file to load -- prawn
(LoadError) from -e:1:in '

The only way I've been able to resolve this is by doing something stupid
like this:

$: << "/usr/local/lib/ruby/gems/1.9.1/gems/prawn-0.5.0.1/lib"

which, of course, is utterly ridiculous. So the question is how do I get
ruby 1.9.1 to recognize and follow the correct gems path? I've never had
this issue with 1.8.7 so I'm assuming it 1.9.1 specific. I feel I'm missing
something completely obvious here and any help would be much appreciated!

I am no expert, but my guess would be to look (at the command line) at

$ gem environment

and at

$ gem help environment

Your GEM_PATH needs to include usr/local/lib/ruby/gems/1.9.1. You can
change it in a .gemrc file, I think. More info here:

http://rubygems.org/read/chapter/11

Hope that turns out to be it - m.

···

Steven Hirsch <swhirsch@nyc.rr.com> wrote:

which, of course, is utterly ridiculous. So the question is how do I get
ruby 1.9.1 to recognize and follow the correct gems path?

Matt Neuburg wrote:

···

Steven Hirsch <swhirsch@nyc.rr.com> wrote:

which, of course, is utterly ridiculous. So the question is how do I get
ruby 1.9.1 to recognize and follow the correct gems path?

I am no expert, but my guess would be to look (at the command line) at

$ gem environment

and at

$ gem help environment

Your GEM_PATH needs to include usr/local/lib/ruby/gems/1.9.1. You can
change it in a .gemrc file, I think. More info here:

http://rubygems.org/read/chapter/11

Hope that turns out to be it - m.

Setting GEM_PATH solved the problem! Thanks very much!! Funny thing is
I never needed to do this with 1.8.7.
--
Posted via http://www.ruby-forum.com/\.