Topic: Running rails 3.0.5 on a server with rails 2.3.5

In the past, I was always able to freeze rails in an app and run them on a server running an older version of rails. I'm trying to do that again with a rails 3.0.5 app on a server running 2.3.5. I've run bundle install --deployment to install gems in vendor and that worked fine but when I try to run migrations I get "You have already activated rake 0.8.3, but your Gemfile requires rake 0.8.7. Consider using bundle exec." Running "bundle exec rake db:migrate"   results in "no such file to load -- bcrypt" error. Basically it's trying to run the older version of rake on the server rather than the one in /vendor/bundle . Does anyone know how to force rails to use the rake gem in vendor/bundle/....? Or should I stop fighting it and roll my app back to rails 2?

Re: Running rails 3.0.5 on a server with rails 2.3.5

This is where rvm comes in to play
See the rvm best practices guide here

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)

Re: Running rails 3.0.5 on a server with rails 2.3.5

Following up --- 
My problem was that I was working on a windows machine and the server was linux. When I ran bundle pack locally, it packed up the windows version of the bcrypt and mysql gems. so bundle install --deployment  just didn't install them. Once I got this worked out, I could run rake tasks like bundle exec rake db:migrate... etc.  I guess thats why your suppose to develop in the same environment you plan to launch in..

Thanks for the help

Last edited by Bishop (2011-07-12 16:27:42)