Problem
Upgrading an existing Ruby on Rails application from 1.2.3, to 2.0.2, presents few problems. I will try and keep a record of the ones I encounter along the way, here.
Solution
- Change the config/environment.rb to let the application know to use the 2.0.2 gem rail version,
- Run the following to generate the secret key for the application:
- Copy the magic key in a new section in your config/environment.rb as in:
change the following line from:
RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
to:
RAILS_GEM_VERSION = "2.0.2" unless defined? RAILS_GEM_VERSION
rake secret
...
# config.log_level = :debug
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
config.action_controller.session = {
:session_key => '_yourapplication_session',
:secret => 'long_string_generated_from_rake_secret'
}