I did the following to implement cron jobs in rails 3 using a "runner" instead of a rake task.
STEP 1: I have whenever gem installed and scheduler.rb has following:
set :environment, development set :output, { :error => "/log/error.log", :standard => "/log/cron.log" } every 1.minute do runner "Cron.sendAutomaticsSMS()" end
STEP 2:
Cron file: lib/cron.rb
class Cron $ # End Whenever generated tasks for: /code/rails_projects/new/bhk/bigbhk-dev/
STEP 3:
Running cron job:
$sudo service cron restart cron stop/waiting cron start/running, process 4027
This does not do anything. I wait for operation as defined in sendAutomaticsSMS() method to execute but the cron doesnt even enter this method.
I dont see any error in log/development.log and there is no log/cron.log in my rails app.