Created
August 9, 2011 09:05
-
-
Save fguillen/1133641 to your computer and use it in GitHub Desktop.
Cron & RVM & Bundle & Rails & Rake & log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00 01 * * * /bin/bash --login -c 'cd <your app> && RAILS_ENV=production /usr/bin/env bundle exec rake <your rake>' >> /var/log/<your app>.log 2>&1 |
Thanks -- I found this via Google and it solved my problem. For whatever reason, bundle exec
wouldn't work for me unless I wrap the command in bash -c "bundle exec ..."
Much appreciated!
Bundle and cron were giving me issues before this. Loading the environment through bash -c worked. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So in whenever:
job_type :rake_with_rvm, "/bin/bash --login -c 'cd :path && RAILS_ENV=:environment /usr/bin/env bundle exec rake :task :output'"