ruby on rails - I get "undefined method `has_key?' for nil:NilClass" for all errors -
my rails version 3.0.4.rc1 , ruby 1.9.3p194
i facing weird problem.
in project getting error nomethoderror: undefined methodhas_key?' nil:nilclassin development.log file andinternal server error undefined method has_key?' nil:nilclass in browser.
for error, if invalid statement, undefined variable, raise, exit, wrong database name.. or else, above error message only. frustrating, cant know error or where(line number , file name) error.
it works fine if there no error, when there error(raise, exit, or other errors) shows same error message. i.e. undefined methodhas_key?' nil:nilclass`
error log:
[2013-04-19 14:41:07] error nomethoderror: undefined method `has_key?' nil:nilclass /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.4.rc1/lib/active_support/whiny_nil.rb:48:in `method_missing' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/runtime.rb:20:in `call' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.4.rc1/lib/active_support/cache/strategy/local_cache.rb:72:in `call' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/lock.rb:13:in `block in call' <internal:prelude>:10:in `synchronize' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/lock.rb:13:in `call' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.4.rc1/lib/action_dispatch/middleware/static.rb:30:in `call' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.4.rc1/lib/rails/application.rb:168:in `call' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.4.rc1/lib/rails/application.rb:77:in `method_missing' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.4.rc1/lib/rails/rack/log_tailer.rb:14:in `call' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/content_length.rb:13:in `call' /home/shweta/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/handler/webrick.rb:52:in `service' /home/shweta/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' /home/shweta/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' /home/shweta/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' this states such issue arises when there syntax error in model, model files fine.
please help.
p.s. don't have issue in rails console.
Comments
Post a Comment