Sunday, March 7, 2010

Running ruby scripts as cron jobs in rvm environment


# This will fail to run properly

*/5 * * * * /usr/bin/env ruby /home/username/twitter.rb

# Need to run the script in full bash environment

*/5 * * * * bash -c 'source /home/username/.rvm/scripts/rvm && /usr/bin/env ruby /home/username/twitter.rb'

1 comment:

Unknown said...

Is this solution capable with rake tasks?

Blog Archive