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
有帮助吗?

解决方案

try to set up your cron task like this

* * * * * /bin/bash -l -c 'rake blah:blah'
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top