javan/whenever — Issue #190: Ubuntu 11.04 rails3 runner don't works 
Author: kucss
Created: 2011-10-25 09:42:38+00:00
State: open

I write a rails3 test class.

class Test
def self.do_job
f = File.new("/home/grant/test.txt", "a+")
f.write("abc\n")
end
end

and the schedule.rb is as bellow

every 1.minutes do
runner "Test.do_job"
end

run update command
$whenever --update-crontab myproject
$crontab -l
* * * * * /bin/bash -l -c 'cd /home/grant/project/myproject && script/rails runner -e production '\''Test.do_job'\'''
$sudo service cron restart

And if you directly run /bin/bash -l -c 'cd /home/grant/project/myproject && script/rails runner -e production '\''Test.do_job'\'''
It runs ok.

But in crontab job. it can not run.

could you help me?