I have setup my schedule.rb file as follows.
set :cron_log, "/log/cron_log.log"
if Rails.env.development?
every 1.minute do
runner "SomeModel.move_values"
runner "SomeOtherModel.dispense"
end
end
I also make it work in development mode by
whenever –update-crontab trunk –set environment=development
But my model methods (class methods) are never called. Is there some way I can verify if its configured right.
when I simply use update it resets the settings to use the production environment.
I just got done using that same javan-whenever plugin.
In terminal, type
crontab -l.If you see the crontab properly generated then you know it’s either the code or some server thing.
You may want to consider doing
set :environment, RAILS_ENVin your schedule.rb file to set the environment dynamically.Ryan Bates has done a good screencast on this:
http://railscasts.com/episodes/164-cron-in-ruby
Also, there are web-based alternatives, for example:
webbasedcron