Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # cron with rbenv
- ## Check your environmental values
- You use `rbenv` and create some ruby script and now 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. 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,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement