Cron needs to be explicitly told which RVM to use, the easiest way to do that is to pretend to open up a bash shell (as all the pre-reqs are loaded by default). Save your afternoon and reuse the following in your crontab: /bin/bash -l -c ‘cd PATH/TO/RAILS/APP && $HOME/.rvm/gems/THE_RVM_RUBY_TO_USE/bin/rake RAILS_ENV=production THE_TAKS:TO_RUN –trace’ for me, …
Continue reading “How to Run a Rake Task via Cron Under RVM”