Migration from Rails 2.2 to 2.3

Published on and tagged with configuration  ruby on rails

Recently, I migrated from Rails 2.2 to 2.3. After installing the new Rails gem I generated a dummy project to compare the generated project structure with the structure of a Rails 2.2 project to find out what changed.

And those are the things I had to change (though most changes seem to be optional):

  • Renaming app/controllers/application.rb to app/controllers/application_controller.rb
  • Replacing config/boot.rb, as it was slightly modified
  • Adding the new “reconnect” option for MySQL databases to config/database.yml (see the release notes)
  • Moving the settings for “config.action_controller.session” and “config.action_controller.session_storage” from config/environment.rb to the new file config/initializers/session_store.rb
  • Changing the value of RAILS_GEM_VERSION from 2.2.2 to 2.3.2 in config/environment.rb
  • Copying config/initializers/backtrace_silencers.rb to my project
  • Adding the setting “config.action_view.cache_template_loading = true” to the production and testing environments (config/environments/production.rb resp. test.rb)
  • Removing the dispatch scripts from the “public” directory, the script/process directory (and its content), plus the “request” script from script/performance

A detailed overview of the changes/new features of Rails 2.3 can be found in the release notes.

4 comments baked

  • Sean

    Make sure your tests work, there was a class moved around that caused all my stuff to break that ended up being a known thing to do with the upgrade.

    BTW, most of the changes are done automatically with the rake rails:update task.


  • cakebaker

    @Sean: Thanks for your hint! My tests also failed and I got an “undefined method use_transactional_fixtures= ” error. To fix this issue I had to rename the class “Test::Unit::TestCase” to “ActiveSupport::TestCase” in test/test_helper.rb.

    And thanks for the tip with “rake rails:update”, I didn’t knew this task yet.

  • Nik

    Daniel, how difficult is to switch to complete new language? I think I couldn’t manage anymore :)

    Nothing against RoR, but I’was used to PHP and Java/Javascript coding style and RoR is looking really horrible.

    Do you have any real project with RoR?

  • cakebaker

    @Nik: Thanks for your comment!

    Good question, and difficult to answer ;-) I think switching to a new language follows the 80/20 rule: 80% is relatively easy to learn, and the last 20% are difficult. I don’t know whether this answers your question…

    Regarding the Ruby coding style: you get used to it after a while. I remember the time when I switched from Java to PHP, at that time I also thought PHP looks horrible with all those ->. In the meantime this style has become normal to me.

    If you mean with “real project” a paid project, then no, there is currently no such project. I’m just working on a personal project.

© daniel hofstetter. Licensed under a Creative Commons License