Devise: undefined method `deep_symbolize_keys' for nil:NilClass

Created on 21 Jun 2010  路  11Comments  路  Source: heartcombo/devise

I've created a brand new Rails 3 app.When I put my before_filter in my controller I get: undefined method `deep_symbolize_keys' for nil:NilClass.

With this stacktrace:
activesupport (3.0.0.beta4) lib/active_support/whiny_nil.rb:48:in method_missing' i18n (0.4.1) lib/i18n/backend/simple.rb:34:instore_translations'
i18n (0.4.1) lib/i18n/backend/base.rb:215:in load_file' i18n (0.4.1) lib/i18n/backend/base.rb:215:ineach'
i18n (0.4.1) lib/i18n/backend/base.rb:215:in load_file' i18n (0.4.1) lib/i18n/backend/base.rb:21:inload_translations'
i18n (0.4.1) lib/i18n/backend/base.rb:21:in each' i18n (0.4.1) lib/i18n/backend/base.rb:21:inload_translations'
i18n (0.4.1) lib/i18n/backend/simple.rb:57:in init_translations' i18n (0.4.1) lib/i18n/backend/simple.rb:71:inlookup'
i18n (0.4.1) lib/i18n/backend/base.rb:34:in translate' i18n (0.4.1) lib/i18n.rb:152:int'
/home/steven/.rvm/gems/ruby-1.8.7-p174/bundler/gems/devise-d498cf3a4e1a3fef3f4f071d4feec6a489efe480-master/lib/devise/failure_app.rb:59:in i18n_message' /home/steven/.rvm/gems/ruby-1.8.7-p174/bundler/gems/devise-d498cf3a4e1a3fef3f4f071d4feec6a489efe480-master/lib/devise/failure_app.rb:49:inredirect'
/home/steven/.rvm/gems/ruby-1.8.7-p174/bundler/gems/devise-d498cf3a4e1a3fef3f4f071d4feec6a489efe480-master/lib/devise/failure_app.rb:30:in respond' actionpack (3.0.0.beta4) lib/abstract_controller/base.rb:145:insend_action'
actionpack (3.0.0.beta4) lib/abstract_controller/base.rb:145:in process_action' actionpack (3.0.0.beta4) lib/abstract_controller/base.rb:114:inprocess'
actionpack (3.0.0.beta4) lib/action_controller/metal.rb:126:in dispatch' actionpack (3.0.0.beta4) lib/action_controller/metal/rack_delegation.rb:14:indispatch'
actionpack (3.0.0.beta4) lib/action_controller/metal.rb:166:in action' /home/steven/.rvm/gems/ruby-1.8.7-p174/bundler/gems/devise-d498cf3a4e1a3fef3f4f071d4feec6a489efe480-master/lib/devise/failure_app.rb:17:incall'
/home/steven/.rvm/gems/ruby-1.8.7-p174/bundler/gems/devise-d498cf3a4e1a3fef3f4f071d4feec6a489efe480-master/lib/devise/failure_app.rb:17:in call' warden (0.10.7) lib/warden/manager.rb:114:incall_failure_app'
warden (0.10.7) lib/warden/manager.rb:100:in process_unauthenticated' warden (0.10.7) lib/warden/manager.rb:47:incall'
actionpack (3.0.0.beta4) lib/action_dispatch/middleware/head.rb:14:in call' rack (1.1.0) lib/rack/methodoverride.rb:24:incall'
actionpack (3.0.0.beta4) lib/action_dispatch/middleware/params_parser.rb:21:in call' actionpack (3.0.0.beta4) lib/action_dispatch/middleware/flash.rb:177:incall'
actionpack (3.0.0.beta4) lib/action_dispatch/middleware/session/abstract_store.rb:106:in call' actionpack (3.0.0.beta4) lib/action_dispatch/middleware/cookies.rb:235:incall'
activerecord (3.0.0.beta4) lib/active_record/query_cache.rb:31:in call' activerecord (3.0.0.beta4) lib/active_record/connection_adapters/abstract/query_cache.rb:28:incache'
activerecord (3.0.0.beta4) lib/active_record/query_cache.rb:11:in cache' activerecord (3.0.0.beta4) lib/active_record/query_cache.rb:30:incall'
activerecord (3.0.0.beta4) lib/active_record/connection_adapters/abstract/connection_pool.rb:365:in call' actionpack (3.0.0.beta4) lib/action_dispatch/middleware/callbacks.rb:46:incall'
activesupport (3.0.0.beta4) lib/active_support/callbacks.rb:414:in _run_call_callbacks' activesupport (3.0.0.beta4) lib/active_support/callbacks.rb:88:insend'
activesupport (3.0.0.beta4) lib/active_support/callbacks.rb:88:in run_callbacks' actionpack (3.0.0.beta4) lib/action_dispatch/middleware/callbacks.rb:44:incall'
rack (1.1.0) lib/rack/sendfile.rb:105:in call' actionpack (3.0.0.beta4) lib/action_dispatch/middleware/remote_ip.rb:48:incall'
actionpack (3.0.0.beta4) lib/action_dispatch/middleware/show_exceptions.rb:48:in call' railties (3.0.0.beta4) lib/rails/rack/logger.rb:14:incall'
rack (1.1.0) lib/rack/runtime.rb:17:in call' activesupport (3.0.0.beta4) lib/active_support/cache/strategy/local_cache.rb:72:incall'
rack (1.1.0) lib/rack/lock.rb:11:in call' rack (1.1.0) lib/rack/lock.rb:11:insynchronize'
rack (1.1.0) lib/rack/lock.rb:11:in call' actionpack (3.0.0.beta4) lib/action_dispatch/middleware/static.rb:30:incall'
railties (3.0.0.beta4) lib/rails/application.rb:145:in call' railties (3.0.0.beta4) lib/rails/application.rb:81:insend'
railties (3.0.0.beta4) lib/rails/application.rb:81:in method_missing' railties (3.0.0.beta4) lib/rails/rack/log_tailer.rb:15:incall'
rack (1.1.0) lib/rack/content_length.rb:13:in call' rack (1.1.0) lib/rack/handler/webrick.rb:48:inservice'
/home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/httpserver.rb:65:inrun'
/home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:162:instart'
/home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:95:instart'
/home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:92:in each' /home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:92:instart'
/home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:23:in start' /home/steven/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:82:instart'
rack (1.1.0) lib/rack/handler/webrick.rb:14:in run' rack (1.1.0) lib/rack/server.rb:155:instart'
railties (3.0.0.beta4) lib/rails/commands/server.rb:62:in start' railties (3.0.0.beta4) lib/rails/commands.rb:30 railties (3.0.0.beta4) lib/rails/commands.rb:27:intap'
railties (3.0.0.beta4) lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6

Most helpful comment

This is happening because you have a locale file with no translations at config/locales/nl.yml and is not a Devise issue. If you add any translation to it, it should work again. :)

All 11 comments

If you are using Rails beta 4, you need to use Devise master. Are you using?

Yes I'm using Devise master. :-)

I cannot reproduce this error. Could you please isolate it in a smaller application and make it online on Github?

As you asked. Problem occurs when I try to access /cars.

Link to the application please?

This is happening because you have a locale file with no translations at config/locales/nl.yml and is not a Devise issue. If you add any translation to it, it should work again. :)

I had a nl.yml. But it disappared for some reason out of Git... I'm quite confused now.

Thanks for looking after it.

Jose is right, or you have some undefined configurations in config/locales/*.yml

For others who stumble upon this issue via Google, manually re-indenting all of the lines in one of my locale files fixed this error.

kenshin6, your comment gives me the clue and I have to re-indent the last line of my :es locale. Thank you

Was this page helpful?
0 / 5 - 0 ratings