whenever 在服务器上执行不了,error.log 显示出错
bin/rails:7: undefined method `require_relative' for main:Object (NoMethodError)
schedule.rb
set :output, { :error => 'error.log', :standard => 'cron.log' }
every :day, :at => '12:00am' do
runner "Account.init_today"
end
every 1.minute do
command "which ruby"
end
crontab -l
# Begin Whenever generated tasks for: dongqilai
0 0 * * * /bin/bash -l -c 'cd /home/ubuntu/www/dongqilai/releases/20141020092136 && bin/rails runner -e production '\''Account.init_today'\'' >> cron.log 2>> error.log'
* * * * * /bin/bash -l -c 'which ruby >> cron.log 2>> error.log'