whenever: Whenever tasks not running on Rails 4
Googled around a bunch and couldn’t find a good answer for this.
I set up whenever per the docs in my rails 4.1.6 app, and am having it run a simple task in schedule.rb:
set :output, "#{path}/log/cron.log"
every 15.minutes do
runner "Order.sync_orders"
end
Order.rb:
#other crap
def self.sync_orders
#do stuff
end
Running ‘whenever’ results in the output:
0,15,30,45 * * * * /bin/bash -l -c 'cd /Users/zach/Apps/myapp && bin/rails runner -e development '\''Order.sync_orders'\'' >> /Users/me/Apps/myapp/log/cron.log 2>&1'
## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated.
## [message] Run `whenever --help' for more options.
The cron.log file is not written to, nor does the method actually get called. The output of crontab -l does indeed list the job there.
Thoughts?
About this issue
- Original URL
- State: open
- Created 10 years ago
- Comments: 19 (2 by maintainers)
Ubuntu 16.04, rbenv, Capistrano, whenever, Rails 5
I followed what was here and it worked. in whenever --update-cron theNameOfCronJob I omitted theNameOfCronJob