Search code examples
ruby-on-rails-3rake-task

rake aborted! no such file to load -- bundler/setup


I run a rake task every night via cron (as root), when it runs it gives the error:

rake aborted!
no such file to load -- bundler/setup

which I get in an email

When I run it manually (as root), it runs just fine.

I am running rvm if that helps.

I am not really sure what to add to help, but here are a few things.

# ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]

# rails -v
Rails 3.0.9

# gem -v
1.8.5

Solution

  • try to set up your cron task like this

    * * * * * /bin/bash -l -c 'rake blah:blah'