[DRE-maint] Debian rails, ruby and $LOAD_PATH

Micah Anderson micah at riseup.net
Fri Apr 24 20:44:01 UTC 2009


The ruby-policy specifies the ruby Module Path for looking for
things in particular order, by default in Debian, this is set to:

=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/i486-linux", "/usr/local/lib/site_ruby/1.8/i386-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/i486-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/i486-linux", "/usr/lib/ruby/1.8/i386-linux", "."]

Which works for the Debian installed ruby libraries, because they get
put under /usr/lib/ruby/1.8 and thus can be found by this search path,
for example, I've got the libncurses-ruby1.8 package installed, and this
works:

irb(main):006:0> require 'ncurses'
=> true

However, when it comes to rails... the Debian packaged rails gets
installed under /usr/share/rails instead of in
/usr/lib/ruby/1.8/rails. Why is that? As a result of this, rails cannot
be found by ruby:

irb(main):007:0> require 'activerecord'
LoadError: no such file to load -- activerecord
	from (irb):7:in `require'
	from (irb):7
	from :0
irb(main):008:0> 

even though I've got the rails package installed. The solution that
people have come up with is to stick symlinks in each application's
vendor directory. This doesn't seem like it should be necessary if the
system's ruby library knew how to find rails. If you run irb and require
'rails' it should not fail.

So the question is either why is rails installed where it is, and if
there is a good reason for why its installed somewhere other than all
the other ruby stuff in Debian, then why doesn't the Debian ruby library
have the $LOAD_PATH configured by default to know about this location?

Thanks for any insight, I think that if this was fixed, it would resolve
some confusion about packaged Rails in debian and we could remove those
silly symlinks (which make for an annoying cap deploy).

micah




More information about the Pkg-ruby-extras-maintainers mailing list