Things to watch out for in Rails 2.3

Recently I was asked on IRC what are the main traps if you want to migrate your application to Rails 2.3.

(NOTE: At the time when I’m writing, Rails 2.3.1 is available which is actually Rails 2.3 RC2. This is a release candidate beta, so even if it is fairly stable, you need to consider using it in production environment or not.)

I am going to collect the list of changes to watch out for with Rails 2.3:

1: Renamed Application Controller

If you have and old Rails project and you are already using Rails 2.3, you may encounter the following problem when you are loading up your console:

$ script/server
Loading development environment (Rails 2.3.1)
/opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:443:in `load_missing_constant':NameError: uninitialized constant ApplicationController

This is because DHH introduced a backwards incompatible change with the Application Controller. He renamed application.rb to application_controller.rb and removed all the special casing that was in place to support the former. You must do this rename in your own application when you upgrade to this version.

Another NOTE: Please do me a favor and leave your comments if you encounter other non-obvious changes while you’re working with Rails 2.3.


3 Responses to “Things to watch out for in Rails 2.3”

  • NoJ Says:

    Thanks for the hint, exactly what I was looking for.

    Cheers
    NoJ

  • Fabrice Says:

    Thanks.
    A related issue concerns the Phusion Passenger Apache module. Those who are using a version of this module < 2.0.6 need to update since the new application controller filename is now supported (otherwise the app won’t start).

    Fabrice.

  • Hamoth Says:

    Users with this problem who browser test a lot might also recognize this as error: uninitialized constant ApplicationController when they upgrade to 2.3 los bastardos!

    Thanks so much for the tip.
    Wouldn’t it be cool if when you updated, app-breaking things like this flashed to the console as a final message in all caps or something?

Leave a Reply