My Rails version is 3.0.4.rc1 and ruby 1.9.3p194
I am facing very weird problem.
In my project I am getting ERROR NoMethodError: undefined method
has_key?' for nil:NilClassin development.log file and
Internal Server Error undefined method has_key?' for nil:NilClass
in browser.
For any error, if its invalid statement, undefined variable, raise, exit, wrong database name.. or anything else, I get the above error message only. It is so frustrating, I cant get to know what is the error or where(line number and file name) is the error.
It works fine if there is no error, but when there is any error(raise, exit, or any other errors) it shows the same error message. i.e. undefined method
has_key?' for nil:NilClass`
Error log:
[2013-04-19 14:41:07] ERROR NoMethodError: undefined method `has_key?' for 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 that such issue arises when there is a syntax error in model, but my model files are fine.
Please help.
P.s. I don't have this issue in rails console.