1

My Rails app starts but gives me a No Method error. I'm not sure what method is apparently being called on something which doesn't. It can;t be a certain site page as it's happening on every url I try to visit. Anyone able hint where it's failing?

Full stack log:

vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:7:in `block in from_exception' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `each' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `each_with_index' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `each' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `map' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `from_exception' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_page.rb:45:in `backtrace_frames' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/middleware.rb:31:in `log_exception' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/middleware.rb:23:in `rescue in app_call' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/middleware.rb:20:in `app_call' vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/middleware.rb:14:in `call' vendor/ruby/1.9.1/gems/bullet-4.1.5/lib/bullet/rack.rb:11:in `call' vendor/ruby/1.9.1/gems/sass-3.2.0/lib/sass/plugin/rack.rb:54:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call' vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call' vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in `call' vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context' vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in `call' vendor/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:in `call' vendor/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call' vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__2841213657923326046__call__4410644436419050805__callbacks' vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback' vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks' vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/reloader.rb:65:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app' vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call' vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call' vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call' vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call' vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call' vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call' vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call' vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:223:in `call' vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call' vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/log_tailer.rb:17:in `call' vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service' /Users/<user>/.rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' /Users/<user>/.rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' /Users/<user>/.rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' 

Error given:

NoMethodError in PagesController#home undefined method `[]' for nil:NilClass 
2
  • What does your home action in the PagesController look like? Commented Jan 8, 2013 at 19:02
  • 1
    I am pretty sure it comes from the better_errors gem Commented Jan 8, 2013 at 19:12

1 Answer 1

1

I'm sure you quite beyond this but just to chime in, I had the same error. I commented out the better_errors gem, re-bundled, reran my app, and found I was getting an error elsewhere. I don't know why better_errors was unable to handle it but once I fixed that other error, I re-enabled better_errors and everything was back to normal.

It's odd b/c I haven't had any problems with the gem before. I love it.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for posting! Since this issue I have managed to re enable better_errors with no problems! Odd but that's life! :-

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.