Problems upgrading from 2.2.2 to 2.3.2 - uninitialized constant ActionController::Failsafe (NameErr


#1

Hi Guys,
I’m trying to get my app up to rails 2.3.2, but I have a problem -
I can’t start the app with Mongrel or Thin, and the “rake middleware”
all return the same error. I’m using the edge version of rails so my
normal dev environment can stay at 2.2.2.

Starting thin, I see:
dkam@Omena ~/Development/rails/booko_rails_2.3 $ thin start

Using rails adapter
/Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/actionpack/
lib/action_dispatch/vendor/rack-1.0/rack.rb:17: warning: already
initialized constant VERSION
/Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/
activesupport/lib/active_support/dependencies.rb:440:in
load_missing_constant': uninitialized constant ActionController::Failsafe (NameError) from /Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/ activesupport/lib/active_support/dependencies.rb:80:inconst_missing’
from /Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/
activesupport/lib/active_support/inflector.rb:361:in constantize' from /Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/ activesupport/lib/active_support/inflector.rb:360:ineach’
from /Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/
activesupport/lib/active_support/inflector.rb:360:in constantize' from /Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/ activesupport/lib/active_support/core_ext/string/inflections.rb:162:inconstantize’
from /Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/
actionpack/lib/action_dispatch/middleware/stack.rb:58:in ==' from /Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/ actionpack/lib/action_dispatch/middleware/stack.rb:97:inindex’
from /Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/
actionpack/lib/action_dispatch/middleware/stack.rb:97:in
insert_after' ... 15 levels... from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/lib/thin/runner.rb:139:inrun!’
from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/bin/thin:6
from /usr/bin/thin:19:in `load’
from /usr/bin/thin:19

Or with Rake:
dkam@Omena ~/Development/rails/booko_rails_2.3 $ rake middleware
(in /Users/dkam/Development/rails/booko_rails_2.3)
rake aborted!
uninitialized constant ActionController::Failsafe

(See full trace by running task with --trace)

Starting the console returns the same error:
dkam@Omena ~/Development/rails/booko_rails_2.3 $ ./script/console
Loading development environment (Rails 2.3.2)
/Users/dkam/Development/rails/booko_rails_2.3/vendor/rails/
activesupport/lib/active_support/dependencies.rb:440:in
`load_missing_constant’:NameError: uninitialized constant
ActionController::Failsafe

I’m running Ruby 1.8.6:
$ ruby --version
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]

Any ideas on what’s causing this and how to fix it?

Cheers,


#2

rename application.rb to application_controller.eb, and next time read
the changelog.


#3

Hey Fernando,

You should find this useful:
http://giantrobots.thoughtbot.com/2009/4/15/rails-2-3-2-upgrade-gotchas

Schalk


#4

Thanks for the suggestion Fernando, but that doesn’t seem to be the
problem.

$ ls -trlh app/controllers/
total 32
-rw-r–r-- 1 dkam dkam 890B 15 Apr 22:56 application_controller.rb
-rw-r–r-- 1 dkam dkam 11K 15 Apr 23:00 books_controller.rb

Any other thoughts?

On Apr 19, 7:59 pm, Fernando P. removed_email_address@domain.invalid


#5

Does anyone have any ideas what causes the “uninitialized constant
ActionController::Failsafe” error? Anyone else seen this?

Note - it’s not the “uninitialized constant ActionController” error
caused by not renaming application.rb to application_controller.rb

Cheers,
Dan