{"action":"opened","issue":{"url":"https://api.github.com/repos/binarylogic/authlogic/issues/467","labels_url":"https://api.github.com/repos/binarylogic/authlogic/issues/467/labels{/name}","comments_url":"https://api.github.com/repos/binarylogic/authlogic/issues/467/comments","events_url":"https://api.github.com/repos/binarylogic/authlogic/issues/467/events","html_url":"https://github.com/binarylogic/authlogic/issues/467","id":99660056,"number":467,"title":"authlogic-3.4.6/lib/authlogic/session/cookies.rb:71:in `sign_cookie': undefined method `cookies' for nil:NilClass (NoMethodError)","user":{"login":"mvastola","id":599767,"avatar_url":"https://avatars.githubusercontent.com/u/599767?v=3","gravatar_id":"","url":"https://api.github.com/users/mvastola","html_url":"https://github.com/mvastola","followers_url":"https://api.github.com/users/mvastola/followers","following_url":"https://api.github.com/users/mvastola/following{/other_user}","gists_url":"https://api.github.com/users/mvastola/gists{/gist_id}","starred_url":"https://api.github.com/users/mvastola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvastola/subscriptions","organizations_url":"https://api.github.com/users/mvastola/orgs","repos_url":"https://api.github.com/users/mvastola/repos","events_url":"https://api.github.com/users/mvastola/events{/privacy}","received_events_url":"https://api.github.com/users/mvastola/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-07T14:38:46Z","updated_at":"2015-08-07T14:38:46Z","closed_at":null,"body":"I'm getting the following error any time I turn on both eager loading of classes in the Rails environment and sign_cookies in the User session:\r\n\r\n```\r\nroot@partyista:/var/rails/partyista-production/current# ./bin/rails c production\r\n/var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/authlogic-3.4.6/lib/authlogic/session/cookies.rb:71:in `sign_cookie': undefined method `cookies' for nil:NilClass (NoMethodError)\r\n        from /var/rails/partyista-production/releases/20150807134234/app/models/user_session.rb:5:in `<class:UserSession>'\r\n        from /var/rails/partyista-production/releases/20150807134234/app/models/user_session.rb:1:in `<top (required)>'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:360:in `require_or_load'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:317:in `depend_on'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:233:in `require_dependency'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:471:in `each'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:471:in `block in eager_load!'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:469:in `each'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:469:in `eager_load!'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:346:in `eager_load!'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/finisher.rb:56:in `each'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'\r\n        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'\r\n        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'\r\n        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'\r\n        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'\r\n        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each'\r\n        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call'\r\n        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'\r\n        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'\r\n        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'\r\n        from /var/rails/partyista-production/releases/20150807134234/config/environment.rb:5:in `<top (required)>'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application.rb:328:in `require_environment!'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:142:in `require_application_and_environment!'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:67:in `console'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/app_rails_loader.rb:45:in `require'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/app_rails_loader.rb:45:in `block in exec_app_rails'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/app_rails_loader.rb:34:in `loop'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/app_rails_loader.rb:34:in `exec_app_rails'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/cli.rb:5:in `<top (required)>'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/bin/rails:9:in `require'\r\n        from /var/rails/partyista-production/shared/bundle/ruby/2.2.0/gems/railties-4.2.3/bin/rails:9:in `<top (required)>'\r\n        from ./bin/rails:16:in `load'\r\n        from ./bin/rails:16:in `<main>'\r\n```\r\n\r\nIt seems that, at the point in the Rails boot process where the error is occurring, Authlogic has not yet been initialized with a controller, so when it is trying to run ```if value && !controller.cookies.respond_to?(:signed)``` (line 71 of lib/authlogic/session/cookies.rb) ```controller``` is understandably ```nil```, causing this error.\r\n\r\nIs there a way I can fix this? And/or is this a bug?\r\nI tried putting Authlogic at the top of my Gemfile but no dice.\r\n\r\nThanks,\r\nMike"}}