19
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

想法?

4

3 回答 3

13

WebRick 已被 Thin 取代。

执行以下操作对我有用:

宝石文件:

gem 'thin' 

现在做bundle install

于 2014-12-26T07:19:43.603 回答
3

我的快速猜测是,您的会话似乎有问题,protect_from_forgery 正在启动。

我遇到了类似的问题并将头撞在墙上几天,结果是我将整个对象分配给了会话对象,而不仅仅是 id。快速说明,非 GET 请求是触发protect_from_forgery 的请求。

于 2012-02-03T06:38:42.687 回答
0

将此添加到我的development.rb文件中解决了该问题。

 config.assets.raise_runtime_errors = true
  config.web_console.whitelisted_ips = replace_this_with_the_public_ip
于 2017-03-25T17:08:54.393 回答