我在Devise中遇到NoMethodError :: SessionsController#destroy undefined method`options' for Hash:尝试使用最新版本的Devise注销我的Rails 3.2应用程序时出现0x00000005aa2df0错误。有人有线索吗?我已经尝试过这里列出的所有常见设计错误而没有运气。
浏览器错误:
NoMethodError in Devise::SessionsController#destroy
undefined method `options' for #<Hash:0x00000004a77368>
Rails.root: /home/hatter/Documents/subspaced
Application Trace | Framework Trace | Full Trace
Request
Parameters:
{"_method"=>"delete",
"authenticity_token"=>"asn7rdKDxLMLXum6sgt09Y9FGsxGGiVNwBr8JNEcI6w="}
Show session dump
flash: #<ActionDispatch::Flash::FlashHash:0x00000004a76490 @used=#<Set: {}>, @closed=false, @flashes={:notice=>"Signed out successfully."}, @now=nil>
Show env dump
GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_ENCODING: "gzip, deflate"
HTTP_ACCEPT_LANGUAGE: "en-US,en;q=0.5"
REMOTE_ADDR: "127.0.0.1"
REMOTE_HOST: "localhost"
SERVER_NAME: "0.0.0.0"
SERVER_PROTOCOL: "HTTP/1.1"
Response
Headers:
None
服务器错误:
Started DELETE "/users/sign_out" for 127.0.0.1 at 2014-04-13 17:10:01 -0400
Processing by Devise::SessionsController#destroy as HTML
Parameters: {"authenticity_token"=>"asn7rdKDxLMLXum6sgt09Y9FGsxGGiVNwBr8JNEcI6w="}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
(0.1ms) begin transaction
(0.1ms) commit transaction
Redirected to http://0.0.0.0:3000/
Completed 302 Found in 5ms (ActiveRecord: 0.4ms)
NoMethodError (undefined method `options' for #<Hash:0x00000004a77368>):
/usr/lib/ruby/vendor_ruby/rack/session/abstract/id.rb:329:in `commit_session'
/usr/lib/ruby/vendor_ruby/rack/session/abstract/id.rb:226:in `context'
/usr/lib/ruby/vendor_ruby/rack/session/abstract/id.rb:220:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/cookies.rb:341:in `call'
/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:64:in `call'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:405:in `_run__1739626826777175734__call__942827542359719520__callbacks'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:405:in `__run_callback'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:385:in `_run_call_callbacks'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:81:in `run_callbacks'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/callbacks.rb:27:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/reloader.rb:65:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/remote_ip.rb:31:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:32:in `call_app'
/usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:16:in `block in call'
/usr/lib/ruby/vendor_ruby/active_support/tagged_logging.rb:22:in `tagged'
/usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:16:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/request_id.rb:22:in `call'
/usr/lib/ruby/vendor_ruby/rack/methodoverride.rb:21:in `call'
/usr/lib/ruby/vendor_ruby/rack/runtime.rb:17:in `call'
/usr/lib/ruby/vendor_ruby/active_support/cache/strategy/local_cache.rb:72:in `call'
/usr/lib/ruby/vendor_ruby/rack/lock.rb:17:in `call'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/static.rb:63:in `call'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:479:in `call'
/usr/lib/ruby/vendor_ruby/rails/application.rb:223:in `call'
/usr/lib/ruby/vendor_ruby/rack/content_length.rb:14:in `call'
/usr/lib/ruby/vendor_ruby/rails/rack/log_tailer.rb:17:in `call'
/usr/lib/ruby/vendor_ruby/rack/handler/webrick.rb:60:in `service'
/usr/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/usr/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/usr/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
退出表格:
<% if user_signed_in? %>
Signed in as <%= current_user.email %>. Not you?
<%= link_to "Sign out", destroy_user_session_path, :method => :delete %>
<% else %>
<%= link_to "Sign up", new_user_registration_path %> or
<%= link_to "Sign in", new_user_session_path %>
<% end %>
提前感谢,我已经被这段时间封锁了。