[rspec-users] $LOAD_PATH problem when creating rake task

Luis Lavena luislavena at gmail.com
Tue Jul 29 05:59:07 EDT 2008

On Tue, Jul 29, 2008 at 11:45 AM, Tero Tilus <tero at tilus.net> wrote:
> I'm trying to put together some rake tasks to run my specs, but
> require 'spec/rake/spectask' complains "no such file".  I've gem
> installed rspec on my Ubuntu box and looks like it's locate in
> /var/lib/gems/1.8/gems/rspec-1.1.4/, which is not in load path
> irb> $LOAD_PATH
> => ["/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/1.8", "/usr/lib/ruby/1.8/i486-linux",
> "/usr/lib/ruby/1.8/i386-linux", "."]
> Now what?  What would be a kosher way around this, maybe ln -s
> something somewhere?  I can see the issue being discussed though,
> https://bugs.launchpad.net/ubuntu/+source/libgems-ruby/+bug/145267

Did you require rubygems first?

irb(main):001:0> puts $LOAD_PATH
=> nil
irb(main):002:0> require 'spec/rake/spectask'
LoadError: no such file to load -- spec/rake/spectask
        from (irb):2:in `require'
        from (irb):2
irb(main):003:0> require 'rubygems'
=> true
irb(main):004:0> require 'spec/rake/spectask'
=> true

Maybe just a stupid comment, if so, please disregard it.
Luis Lavena
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams

More information about the rspec-users mailing list