0

我无法退出自己的页面,因为undefined method每次尝试时都会收到 Puma 错误。大多数时候是extract_multipart,但我也见过before_create

每当我单击注销时,这就是空白页面中显示的内容

Puma caught this error: undefined method `extract_multipart' for Rack::Multipart:Module (NoMethodError)
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/request.rb:472:in `parse_multipart'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/request.rb:335:in `POST'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/method_override.rb:39:in `method_override_param'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/method_override.rb:27:in `method_override'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/method_override.rb:15:in `call'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/runtime.rb:22:in `call'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/var/lib/gems/2.3.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/executor.rb:12:in `call'
/var/lib/gems/2.3.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/static.rb:136:in `call'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/sendfile.rb:111:in `call'
/var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/engine.rb:522:in `call'
/var/lib/gems/2.3.0/gems/puma-3.6.2/lib/puma/configuration.rb:225:in `call'
/var/lib/gems/2.3.0/gems/puma-3.6.2/lib/puma/server.rb:578:in `handle_request'
/var/lib/gems/2.3.0/gems/puma-3.6.2/lib/puma/server.rb:415:in `process_client'
/var/lib/gems/2.3.0/gems/puma-3.6.2/lib/puma/server.rb:275:in `block in run'
/var/lib/gems/2.3.0/gems/puma-3.6.2/lib/puma/thread_pool.rb:116:in `block in spawn_thread'

我管理注销的方式是

<%= link_to(logout_path, method: 'delete', class: 'dropdown-item') do %>
<!-- ... -->
<% end %>

其中路由定义为delete 'logout' => 'sessions#destroy',控制器/动作为

def destroy
  session[:id] = nil
  redirect_to '/login'
end

我只发现一两次的另一个错误,我所拥有的只是一个截图

彪马:未定义before_create

关于可能导致这种情况的任何想法?预先感谢:)

编辑

根据要求,这是一个Enumerable问题,我实际上并没有使用它,因为我也有这个问题(在 auto-inc 存储库上提交的 GH 问题)

require 'autoinc'

module Enumerable
  extend ActiveSupport::Concern

  included do
    include Mongoid::Autoinc
    include Mongoid::Document

    field :n, as: :number, type: Integer

    increments :number
  end
end

before_create我唯一使用的是在一个完全不相关的模块中......

编辑 2

尝试将 puma 更新为3.7.0,但没有解决。虽然它没有进一步打破它......

4

1 回答 1

0

答案来自

删除链接在 Rails 3 视图中发送“Get”而不是“Delete”

我需要添加<%= csrf_meta_tag %>到我的head.

于 2017-01-29T22:48:41.787 回答