[Rubygems-developers] LOAD_PATH Ordering with Ruby 1.9 Gems

Eric Hodel drbrain at segment7.net
Sat Jan 5 04:16:49 EST 2008


On Dec 21, 2007, at 06:39 AM, Jim Weirich wrote:

> When I try to override the installed rake in Ruby 1.9 with a gem, I
> get the following error:
>
> /Users/jim/local/ruby19/bin/rake:19:in `load': Is a directory - /
> Users/jim/local/ruby19/lib/ruby/gems/1.9/gems/rake-0.8.0/lib/rake
> (Errno::EISDIR)
> 	from /Users/jim/local/ruby19/bin/rake:19:in `<main>'
>
> It seems that the 'lib' directory in the rake gem preceeds the 'bin'
> directory, so loading 'rake' will find 'lib/rake' and complain about
> that.  Pre-1.9 versions of gem put the bin directory first, so that
> load 'rake' would find that.
>
> Was this a deliberate change?

gem_prelude.rb was adding paths in the wrong order.  I fixed it  
independently of your discovery before 1.9.0.

> (Actually, I never liked the whole idea of including the bin
> directory in the load path in the first place.  Seems to me that we
> could have made the executable stub a wee bit smarter ... but I
> digress).

It's not optimal, but it works, so I'm hesitant to change it just yet.


More information about the Rubygems-developers mailing list