ruby-on-rails-3 – 错误Errno :: ECONNRESET:由对等体重新连接

gem 'rails','3.0.0'
gem 'devise'
gem 'bson_ext','>= 1.0.7'
gem 'bson','>= 1.0.7'
gem 'mongo_mapper',:branch => 'rails3',:git => 'http://github.com/jnunemaker/mongomapper.git'
gem 'devise-mongo_mapper',:git => 'git://github.com/collectiveidea/devise-mongo_mapper'

使用上述设置,我会收到以下请求错误

Started GET "/users/sign_out" for 127.0.0.1 at 2010-09-27 13:16:30 +0300
  Processing by Devise::SessionsController#destroy as HTML
Redirected to http://localhost:3000/
Completed 302 Found in 19ms
[2010-09-27 13:16:31] ERROR Errno::ECONNRESET: Connection reset by peer
    /usr/local/ruby/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `eof?'
    /usr/local/ruby/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `run'
    /usr/local/ruby/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'


Started GET "/users/edit" for 127.0.0.1 at 2010-09-27 13:16:35 +0300
  Processing by Devise::RegistrationsController#edit as HTML
Completed   in 16ms
[2010-09-27 13:16:35] ERROR Errno::ECONNRESET: Connection reset by peer
    /usr/local/ruby/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `eof?'
    /usr/local/ruby/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `run'
    /usr/local/ruby/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

用户型号:

class User
  include MongoMapper::Document
  plugin MongoMapper::Devise
  devise :registerable,:database_authenticatable,:recoverable
end

想法?

解决方法

快速猜测,这看起来像你的会话有问题,而protect_from_forgery正在踢.

我有一个类似的问题,把我的头砸在墙上几天,原来是将整个对象分配给一个会话对象而不是id.一个快速注释,非GET请求是触发protect_from_forgery的请求.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...