If your cron does not work, in many cases, that's because enviromental value.
You use rbenv
and created some ruby scripts. Now you want to set it to cron
.
43 19 * * * ruby your_ruby_script.rb
Later, you find it does not work while your syslog
says that the job itself is propary triggered. Then, it is most likely because of cron
environmental value. Probably you miss the environmental value such as path to the right ruby. Check this:
crontab -e
43 19 * * * ruby -v; /home/ubuntu/.rbenv/shims/ruby -v >> /tmp/ruby.type
In my case, the out put is:
cat /tmp/ruby.type
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
The script was grabbing wrong ruby with wrong set of gem
s.
Correcting the ruby path soleved.
43 19 * * * /home/ubuntu/.rbenv/shims/ruby your_ruby_script.rb
Cheers,