path - Rake task which executes other rake tasks via system fails -- no such file to load 'rake' -
i've written rake task run few other rake tasks via system (so bind activerecord different databases, among other things). works fine on os x box, fails on our production linux boxes load error. tasks trivially boil down to:
namespace :jobs task :foo => :environment system "rake jobs:bar" end task :bar => :environment puts "foobar" end
and traced output is:
-bash-3.2$ rake jobs:foo --trace (in /the/path) ** invoke jobs:foo (first_time) ** invoke environment (first_time) ** execute environment ** erubis 2.6.6 ** execute jobs:foo /usr/bin/rake:19:in `load': no such file load -- rake (loaderror) /usr/bin/rake:19
i dumped puts $: /usr/bin/rake , have discovered interesting. primary job has load path containing both of these paths:
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib
while secondary job has load path containing only:
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib
which explains load error, not reason it. ideas?
check make sure install has set required environment variables correctly. http://docs.rubygems.org/read/chapter/3 same problem occurred me when using "export rubyopt=rubygem" instead of "export rubyopt=rubygems". ahh difference single character can make.
Comments
Post a Comment