Solve uninitialized constant ApplicationController in Rails 2.3

So I am casually writing my Ruby on Rails application, like I have a million times before on the newest version of Rails (which at time of writing, was version 2.3).  So I open up an blank project with some code I use in all my Rails apps, and copy over the relevant files, and replace the application_crontroller.rb with application.rb.

But as it turns out, there were some major changes with 2.3, not the least being that the application controller is no longer called application.rb Now it’s referred to as application_controller.rb.

So it’s easy to fix, just rename the file or, it you’re into scripty goodness, run:

rake rails:update

Be sure to update your server stack before deploying. Obviously if you rename the file to get it working on Rails 2.3 and upload to a Rails 2.2 server you’ll be in trouble. Don’t forget that Rails 2.3 also requires a new version of Phusion Passenger!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.