Puma 发现此错误:无效的选项密钥:urlsafe_csrf_tokens= (RuntimeError)

问题描述 投票:0回答:1

我刚刚将 Rails 6.1.7.7 应用程序升级到 7.1.3.2。我的puma版本是6.4.2。现在,当我尝试在浏览器中加载应用程序(http://localhost:3000)时,我收到此消息

Puma caught this error: Invalid option key: urlsafe_csrf_tokens= (RuntimeError)
后面有痕迹

/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_controller/railtie.rb:93:in `block (3 levels) in <class:Railtie>'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_controller/railtie.rb:88:in `each'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_controller/railtie.rb:88:in `block (2 levels) in <class:Railtie>'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:97:in `class_eval'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:97:in `block in execute_hook'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:77:in `each'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_controller/base.rb:258:in `<class:Base>'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_controller/base.rb:169:in `<module:ActionController>'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_controller/base.rb:7:in `<top (required)>'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_dispatch/middleware/static.rb:171:in `each_candidate_filepath'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_dispatch/middleware/static.rb:103:in `find_file'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_dispatch/middleware/static.rb:71:in `attempt'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_dispatch/middleware/static.rb:25:in `call'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/rack-2.2.9/lib/rack/sendfile.rb:110:in `call'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/actionpack-7.1.3.2/lib/action_dispatch/middleware/host_authorization.rb:141:in `call'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/railties-7.1.3.2/lib/rails/engine.rb:536:in `call'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/puma-6.4.2/lib/puma/configuration.rb:272:in `call'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/puma-6.4.2/lib/puma/request.rb:100:in `block in handle_request'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/puma-6.4.2/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/puma-6.4.2/lib/puma/request.rb:99:in `handle_request'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/puma-6.4.2/lib/puma/server.rb:464:in `process_client'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/puma-6.4.2/lib/puma/server.rb:245:in `block in run'
/Users/dsadaka/.rvm/gems/ruby-2.7.1@esebco_marc-r271/gems/puma-6.4.2/lib/puma/thread_pool.rb:155:in `block in spawn_thread'

我尝试过设置

    config.action_controller.urlsafe_csrf_tokens = false
    config.action_controller.urlsafe_csrf_tokens = true
并重新启动应用程序但没有成功。 我在任何地方都找不到其他人遇到这个问题。

有谁知道发生了什么事以及如何解决这个问题?

谢谢, 丹

ruby-on-rails puma
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.