Thursday, September 2, 2010

How to update Ruby on Rails applications from 2.2 to 2.3 version of Rails

To update a Ruby on Rails application from 2.2 to 2.3 version of Rails you have to go through the following steps:
  1. Intall the 2.3 version of Rails with gem.
  2. Update file config/environment.rb and specify the new Rails version (RAILS_GEM_VERSION).
  3. Run rails:update task of rake at the project home.
  4. Add/Remove the generated/removed files inside your SCM software.
I have updated an application managed with CVS SCM software from 2.2.3 to 2.3.8, so I did:

(1) gem install rails -v 2.3.8 (as root)

(2) vi config/environment.rb

RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION


(3) rake rails:update

(in /home/user/project)
/home/user/project/app/controllers/application.rb has been renamed to /home/user/project/app/controllers/application_controller.rb, update your SCM as necessary


(4) cvs add app/controllers/application_controller.rb

(5) cvs remove app/controllers/application.rb

(6) commit

0 comments: