Hi Since upgrading Rails my application generates errors for some (but not all) of my controllers. Something to do with Helpers - which I don''t use. I have tried freshly installing Ruby and Rails but it doesn''t help. Thanks for any help Peter ******************************************************** NameError in <controller not set>#<action not set> uninitialized constant UsersHelper app/controllers/users_controller.rb:1 script/server:48 Show framework trace c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:181:in `const_missing'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co re_ext/string/../../inflector.rb:53:in `const_get'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co re_ext/string/../../inflector.rb:53:in `constantize'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co re_ext/string/../../inflector.rb:52:in `inject'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co re_ext/string/../../inflector.rb:52:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co re_ext/string/../../inflector.rb:52:in `inject'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co re_ext/string/../../inflector.rb:52:in `constantize'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co re_ext/string/inflections.rb:44:in `constantize'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/he lpers.rb:64:in `helper'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/he lpers.rb:48:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/he lpers.rb:48:in `helper'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/he lpers.rb:94:in `inherited_without_api'' c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-0.6.2/lib/action_web_ser vice/container/action_controller_container.rb:86:in `inherited_without_action_controller'' c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-0.6.2/lib/action_web_ser vice/dispatcher/action_controller_dispatcher.rb:33:in `inherited'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:187:in `load'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:187:in `load'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:38:in `require_or_load'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:21:in `depend_on'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:165:in `require_dependency'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:165:in `require_dependency'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:121:in `load_file!'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:90:in `const_load!'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:76:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:76:in `const_load!'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:69:in `const_missing'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:165:in `const_get'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:165:in `eat_path_to_controller'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:161:in `inject'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:161:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:161:in `inject'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:161:in `eat_path_to_controller'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:115:in `recognize'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:109:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:109:in `recognize'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:278:in `recognize!'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:277:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:230:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:230:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro uting.rb:277:in `recognize!'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.11.1/lib/dispatcher.rb:32:in `dispatch'' C:/rails/tb2/public/dispatch.rb:10 c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:187:in `load'' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de pendencies.rb:187:in `load'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.11.1/lib/webrick_server.rb:84:in `handle_dispatch'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.11.1/lib/webrick_server.rb:35:in `do_GET'' c:/ruby/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'' c:/ruby/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.11.1/lib/webrick_server.rb:21:in `dispatch'' This error occured while loading the following files: ./script/../config/../app/controllers/users_controller.rb ********************************************************************* C:\rubylib\RMagick-1.7.0-gem>gem list C:\rubylib\RMagick-1.7.0-gem>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" li *** LOCAL GEMS *** actionmailer (0.8.1) Service layer for easy email delivery and testing. actionpack (1.7.0) Web-flow and rendering framework putting the VC in MVC. actionwebservice (0.6.2) Web service support for Action Pack. activerecord (1.9.1) Implements the ActiveRecord pattern for ORM. activesupport (1.0.3) Support and utility classes used by the Rails framework. fxruby (1.2.2) FXRuby is the Ruby binding to the FOX GUI toolkit. rails (0.11.1) Web-application framework with template engine, control-flow layer, and ORM. rake (0.5.0) Ruby based make-like utility. RMagick-win32 (1.7.0) RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries. rubygems-update (0.8.10) RubyGems Update GEM sources (0.0.1) This package provides download sources for remote gem installation
Yep, I think I''m also having similar problems. On Wed, 30 Mar 2005 12:25:22 +0200, Cutting Peter <Peter.Cutting-CwpgxV1jTAxWk0Htik3J/w@public.gmane.org> wrote:> Hi > Since upgrading Rails my application generates errors for some (but not > all) of my controllers. Something to do with Helpers - which I don''t > use. I have tried freshly installing Ruby and Rails but it doesn''t help. > Thanks for any help > Peter > > ******************************************************** > NameError in <controller not set>#<action not set> > > uninitialized constant UsersHelper > > app/controllers/users_controller.rb:1 > script/server:48 > > Show framework trace > > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:181:in `const_missing'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co > re_ext/string/../../inflector.rb:53:in `const_get'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co > re_ext/string/../../inflector.rb:53:in `constantize'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co > re_ext/string/../../inflector.rb:52:in `inject'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co > re_ext/string/../../inflector.rb:52:in `each'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co > re_ext/string/../../inflector.rb:52:in `inject'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co > re_ext/string/../../inflector.rb:52:in `constantize'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/co > re_ext/string/inflections.rb:44:in `constantize'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/he > lpers.rb:64:in `helper'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/he > lpers.rb:48:in `each'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/he > lpers.rb:48:in `helper'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/he > lpers.rb:94:in `inherited_without_api'' > c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-0.6.2/lib/action_web_ser > vice/container/action_controller_container.rb:86:in > `inherited_without_action_controller'' > c:/ruby/lib/ruby/gems/1.8/gems/actionwebservice-0.6.2/lib/action_web_ser > vice/dispatcher/action_controller_dispatcher.rb:33:in `inherited'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:187:in `load'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:187:in `load'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:38:in `require_or_load'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:21:in `depend_on'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:165:in `require_dependency'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:165:in `require_dependency'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:121:in `load_file!'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:90:in `const_load!'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:76:in `each'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:76:in `const_load!'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:69:in `const_missing'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:165:in `const_get'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:165:in `eat_path_to_controller'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:161:in `inject'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:161:in `each'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:161:in `inject'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:161:in `eat_path_to_controller'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:115:in `recognize'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:109:in `each'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:109:in `recognize'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:278:in `recognize!'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:277:in `each'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:230:in `each'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:230:in `each'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.7.0/lib/action_controller/ro > uting.rb:277:in `recognize!'' > c:/ruby/lib/ruby/gems/1.8/gems/rails-0.11.1/lib/dispatcher.rb:32:in > `dispatch'' > C:/rails/tb2/public/dispatch.rb:10 > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:187:in `load'' > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.0.3/lib/active_support/de > pendencies.rb:187:in `load'' > c:/ruby/lib/ruby/gems/1.8/gems/rails-0.11.1/lib/webrick_server.rb:84:in > `handle_dispatch'' > c:/ruby/lib/ruby/gems/1.8/gems/rails-0.11.1/lib/webrick_server.rb:35:in > `do_GET'' > c:/ruby/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'' > c:/ruby/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service'' > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' > c:/ruby/lib/ruby/gems/1.8/gems/rails-0.11.1/lib/webrick_server.rb:21:in > `dispatch'' > > This error occured while loading the following files: > ./script/../config/../app/controllers/users_controller.rb > ********************************************************************* > C:\rubylib\RMagick-1.7.0-gem>gem list > C:\rubylib\RMagick-1.7.0-gem>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" li > *** LOCAL GEMS *** > actionmailer (0.8.1) > Service layer for easy email delivery and testing. > actionpack (1.7.0) > Web-flow and rendering framework putting the VC in MVC. > actionwebservice (0.6.2) > Web service support for Action Pack. > activerecord (1.9.1) > Implements the ActiveRecord pattern for ORM. > activesupport (1.0.3) > Support and utility classes used by the Rails framework. > fxruby (1.2.2) > FXRuby is the Ruby binding to the FOX GUI toolkit. > rails (0.11.1) > Web-application framework with template engine, control-flow layer, > and ORM. > rake (0.5.0) > Ruby based make-like utility. > RMagick-win32 (1.7.0) > RMagick is an interface between the Ruby programming language and > the ImageMagick and GraphicsMagick image processing libraries. > rubygems-update (0.8.10) > RubyGems Update GEM > sources (0.0.1) > This package provides download sources for remote gem installation > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I have found a workaround to the problem:- Delete all your empty helper files This suggests that Rails is (incorrectly?) expecting something in the helper file besides:- module FooHelper end Peter
Peter, Did you update your environment.rb? What does your logfile say? I seem to remember that the NameError error wasn''t always a useful message when getting it from the browser, so scout your logfile. Rails doesn''t expect anything but module FooHelper;end; in helpers -- johan On Apr 1, 2005 2:34 PM, Cutting Peter <Peter.Cutting-CwpgxV1jTAxWk0Htik3J/w@public.gmane.org> wrote:> I have found a workaround to the problem:- > Delete all your empty helper files > > This suggests that Rails is (incorrectly?) expecting something in the > helper file besides:- > module FooHelper > end > > Peter > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >