Forum: Ruby on Rails NameError (uninitialized constant UnknownAction)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tony B. (Guest)
on 2006-02-08 23:36
Hi, I'm having a strange problem that only seems to be happening on our
production server.  I never get this error locally but get it quite
often on the server.  The other odd thing is it doesn't seem to be
resulting in any error pages on the site.  Everything looks fine...

I wanted to add a rescue_action_in_public to email me when there are
errors.  So I followed the example from the agile book (p. 464).  Pretty
much word for word.  Here's the error I'm occasionally seeing in the
production.log.  Any ideas as to why it thinks
ActionController::UnknownAction is uninitialized?

NameError (uninitialized constant UnknownAction):
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:195:in
`const_missing'
    /app/controllers/application.rb:13:in `rescue_action_in_public'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:33:in
`rescue_action'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:108:in
`perform_action'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
`process_without_session_management_support'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session_management.rb:116:in
`process'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in
`dispatch'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:141:in
`process_request'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in
`process!'
    /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi'
    /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
`process!'
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:in
`process!'
    /home/www/www.evoketv.com/htdocs/public/dispatch.fcgi:24
Kent S. (Guest)
on 2006-02-09 00:08
(Received via mailing list)
If you use UnknownAction in your rescue_action_in_public method, try
to use the full reference like so ::ActionController::UnknownAction

Kent.
Tony B. (Guest)
on 2006-02-11 00:58
Kent S. wrote:
> If you use UnknownAction in your rescue_action_in_public method, try
> to use the full reference like so ::ActionController::UnknownAction

That was the problem.  Thanks!
This topic is locked and can not be replied to.