Crontab + rails3 + bundler

I run crontab, which performs the rake task. I get the following error (with MAILTO from crontab):

rake aborted!
no such file to load -- bundler
/Users/Mendel/Sites/misnooit/Rakefile:4
(See full trace by running task with --trace)

I am using rvm with:
ruby: ruby ​​1.9.1p378
rails: Rails 3.0.0.beta
$ GEM_HOME: /Users/Mendel/.rvm/gems/ruby-1.9.1-p378
bundler: bundler (0.9.11)

The error is pretty clear, but I can't fix it. Does anyone have more knowledge about this? Thanks in advance.

+5
source share
5 answers

. , rake ruby, , /usr/local/bin. /usr/bin ( , , apt-get ..).

, crontab ,

PATH =/USR//:/USR/:/

( PATH =/usr/bin:/bin crontab)

.

+6

: Ruby 1.9.1p378 Ruby ?

, , rvm --defaults "ruby-1.9.1-p378" , , ruby ​​1.9?

, / cron , . rvm "root" (- root) RVM , . , , .

+1

, http://github.com/javan/whenever

Ruby DSL cron .

every 3.hours do
  runner "MyModel.some_process"
  rake "my:rake:task"
end
+1

--trace, , rake , crontab

rvm 1.9.1;rake do_whatever_task

, ruby ​​ rake.

+1

I had a similar problem this weekend, I found that my Rake Gem was updated to 0.90, you need 0.8.7 rake. This solved the problem on my part.

0
source

All Articles