javan/whenever — Issue #216: please do not use login shell in cron
Author: mpapis
Created: 2012-02-28 23:26:10+00:00
State: open

Hi,

The default template https://github.com/javan/whenever/blob/master/lib/whenever/setup.rb#L8 uses `bash -l` this is not good idea and might lead to serious issues like this: https://github.com/wayneeseguin/rvm/issues/791

You can find description for bash login here: https://rvm.beginrescueend.com/support/faq/#shell_login

RVM provides few ways to call cron jobs:https://rvm.beginrescueend.com/integration/cron/
in worst case if none of them work for you you can try this:

$rvm_path/bin/rvm /path/to/project do

set the rvm_path in cron or replace it with full path.

if you like I can extend rvm to allow:

rvm in /path/to/project do ... #or
rvm --cd /path/to/project do ...

which will additionally to switching ruby also change to the given directory.

Thanks,
Michal