# Ruby 1.9.1 load path craziness!

**URL:** <https://www.ruby-forum.com/t/ruby-1-9-1-load-path-craziness/171186>\
**Category:** Ruby\
**Created:** [June 28, 2009, 12:16am UTC](https://www.ruby-forum.com/t/ruby-1-9-1-load-path-craziness/171186 "2009-06-28T00:16:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [June 28, 2009, 12:16am UTC](https://www.ruby-forum.com/t/ruby-1-9-1-load-path-craziness/171186/1 "2009-06-28T00:16:18Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [June 28, 2009, 2:30am UTC](https://www.ruby-forum.com/t/ruby-1-9-1-load-path-craziness/171186/2 "2009-06-28T02:30:46Z")

</div>

Steven H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://rubygems.org/read/chapter/11)

Hope that turns out to be it - m.

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [June 28, 2009, 4:42am UTC](https://www.ruby-forum.com/t/ruby-1-9-1-load-path-craziness/171186/3 "2009-06-28T04:42:03Z")

</div>

Matt N. wrote:

> Steven H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](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.
