Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade rails app from 2.2.2 to 2.3.11?

I have installed rails.2.3.11 and run rake rails:upgrade.

Do i need to modify anymore files ?

like image 238
krunal shah Avatar asked Mar 01 '11 13:03

krunal shah


1 Answers

Steps for upgrading Rails 2.2.2 to 2.3.11.

  1. rails install -v=2.3.11

  2. modify config/environment.rb

    RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
    
  3. run rake task => rake rails:update # Update configs, scripts and javascripts

    This rake task will modify some of the files.

  4. modify config/environment.rb

    Replace

    config.action_controller.session = {
      :session_key => '_name_session',
      :secret      => 'asdfasfasfafafafadaseerweewr'
    }
    

    with

    config.action_controller.session = {
      :key => '_name_session',
      :secret      => 'asdfasfasfafafafadaseerweewr'
    } 
    
  5. modify app/controllers/application_controller.rb

    Replace

    session :session_key => '_intrado_session_id'
    

    with

    #session :session_key => '_intrado_session_id'
    
  6. Replace

    session.session_id
    

    with

    request.session_options[:id]
    

May be this will help...

EDIT:

Rails 2.3.11 + Rack 1.0.0 + Phusion Passenger 2.0.6 causing problem 500 internal server error undefined method 'rewind' to solve that issue.

I have installed.

  1. sudo gem install rack -v=1.1.1

  2. sudo gem install passenger -v=2.2.8

  3. passenger-install-apache2-module

It would prompt you to replace few lines in /etc/httpd/conf/httpd.conf with the following at the end of installation of the 3nd step

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.8/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.8
PassengerRuby /usr/local/bin/ruby

This file would already have above three lines. So, it would be sufficient to replace 2.0.6 with 2.2.8.

After performing the above steps, restart apache2 and restart rails by the following commands.

  1. sudo /etc/init.d/http.d restart
  2. cd /var/www/project_name
  3. sudo touch tmp/restart.txt
like image 169
krunal shah Avatar answered Oct 31 '22 16:10

krunal shah