简体   繁体   中英

Puma caught this error: Invalid option key: raise_on_unfiltered_parameters

I am learning Ruby on Rails with Michael Hartl's book Ruby on Rails™ Tutorial: Learn Web Development with Rails, Fourth Edition . I got the error message when trying the toy_app . Does anyone know what's wrong?

Puma caught this error: Invalid option key: raise_on_unfiltered_parameters= (RuntimeError)
.gem/ruby/gems/actionpack-5.0.0/lib/action_controller/railtie.rb:59:in `block (3 levels) in <class:Railtie>'
.gem/ruby/gems/actionpack-5.0.0/lib/action_controller/railtie.rb:54:in `each'
.gem/ruby/gems/actionpack-5.0.0/lib/action_controller/railtie.rb:54:in `block (2 levels) in <class:Railtie>'
.gem/ruby/gems/activesupport-5.0.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
.gem/ruby/gems/activesupport-5.0.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
.gem/ruby/gems/activesupport-5.0.0/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
.gem/ruby/gems/activesupport-5.0.0/lib/active_support/lazy_load_hooks.rb:44:in `each'
.gem/ruby/gems/activesupport-5.0.0/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
.gem/ruby/gems/actionpack-5.0.0/lib/action_controller/base.rb:263:in `<class:Base>'
.gem/ruby/gems/actionpack-5.0.0/lib/action_controller/base.rb:164:in `<module:ActionController>'
.gem/ruby/gems/actionpack-5.0.0/lib/action_controller/base.rb:5:in `<top (required)>'
.gem/ruby/gems/actionpack-5.0.0/lib/action_dispatch/middleware/static.rb:77:in `ext'
.gem/ruby/gems/actionpack-5.0.0/lib/action_dispatch/middleware/static.rb:33:in `match?'
.gem/ruby/gems/actionpack-5.0.0/lib/action_dispatch/middleware/static.rb:130:in `call'
.gem/ruby/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in `call'
.gem/ruby/gems/railties-5.0.0/lib/rails/engine.rb:522:in `call'
.gem/ruby/gems/puma-3.4.0/lib/puma/configuration.rb:224:in `call'
.gem/ruby/gems/puma-3.4.0/lib/puma/server.rb:569:in `handle_request'
.gem/ruby/gems/puma-3.4.0/lib/puma/server.rb:406:in `process_client'
.gem/ruby/gems/puma-3.4.0/lib/puma/server.rb:271:in `block in run'
.gem/ruby/gems/puma-3.4.0/lib/puma/thread_pool.rb:114:in `call'
.gem/ruby/gems/puma-3.4.0/lib/puma/thread_pool.rb:114:in `block in spawn_thread'

Update: commenting out raise_on_unfiltered_parameters resolves the issue.

I was having this same issue and thi was how i solved it: go to the

config/initializers/new_framework_defaults.rb

and comment or delete this line of code:

 Rails.application.config.action_controller.raise_on_unfiltered_parameters = true

i hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM