Ruby on Rails
HowtoUpgrade
How to Upgrade Rails
Run Gem to Grab the Latest Release
- sudo gem update rails -y
- sudo gem update rake -y
- sudo gem update activerecord -y
- sudo gem update activesupport -y
- sudo gem update actionpack -y
- sudo gem update actionmailer -y
- sudo gem update activeresource -y or possibly sudo gem install activeresource -y
How to Upgrade Existing Projects
- Open _your_project/config/environment.rb_ and change _RAILS_GEM_VERSION_ to point to the version you just upgraded to
- Run rake rails:update from your project’s root directory
- Verify that any tests you may have written still pass
Please note that I didn’t find this documented anywhere and this appeared to work for me. I’m not sure if this is the official way of upgrading or not.
On page 32 of Agile Web Development with Rails, Dave Thomas gives the same instructions minus the editing of the environment.rb file (which I needed to do to get it to work). He also reminds us that:
will get rid of older versions of rails, and mentions that the reason for the rake rails:update is to copy in any new versions of javascript libraries, etc.