Ruby on Rails
HowtoUpgrade (Version #14)

How to Upgrade Rails

Run Gem to Grab the Latest Release

  • gem update rails -y

or

  • sudo gem update rails -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:

  • gem cleanup

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.

How to Upgrade Rails

Run Gem to Grab the Latest Release

  • gem update rails -y

or

  • sudo gem update rails -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:

  • gem cleanup

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.