I’ve upgraded to rails 3.0.9 which has introduced the rake issues. I’ve gotten it all resolved except for a problem with a cron job.
This used to work:
#!/bin/sh
source /usr/local/rvm/scripts/rvm
cd /home/p1r65759/apps/abbc/
/usr/local/bin/rake refresh_events RAILS_ENV=production
But now I get this error:
You have already activated rake 0.8.7, but your Gemfile requires rake 0.9.2. Consider using bundle exec.
/home/p1r65759/apps/abbc/Rakefile:4:in `’
(See full trace by running task with –trace)
How do I modify my script to use bundle exec so it will use the proper version of rake and run successfully?
Thanks.
If you are using bundler for your application then you don’t need to use “/usr/local/bin/rake” as a path for rake.
you can just use
so your new script will be
bundle exec will work because you are already in your project directory.
And don’t forgot to include rake in your Gemfile.