You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Rails教程toy_app时遇Puma报错:Invalid option key: raise_on_unfiltered_parameters

Fixing the "Invalid option key: raise_on_unfiltered_parameters=" Error in Rails 5.0.0

Hey there! I’ve run into this exact issue before while working through Hartl’s Rails Tutorial—let’s get your toy_app back up and running smoothly.

What’s causing the error?

The raise_on_unfiltered_parameters configuration option was introduced in Rails 5.1, but you’re using Rails 5.0.0. This older version doesn’t recognize the setting, which is why Puma is throwing that RuntimeError.

Two straightforward fixes:

Option 1: Remove the unsupported configuration

  1. Open your app’s configuration files—check either config/application.rb or environment-specific files like config/environments/development.rb.
  2. Search for the line that looks like this:
    config.action_controller.raise_on_unfiltered_parameters = true
    
  3. Either delete that line entirely, or comment it out with a # at the start:
    # config.action_controller.raise_on_unfiltered_parameters = true
    
  4. Restart your Puma server, and the error should vanish.

Option 2: Upgrade Rails to match the tutorial

The fourth edition of Hartl’s Tutorial is built for Rails 5.1.x, so upgrading will align your setup with the guide’s instructions:

  1. Open your Gemfile and find the Rails line:
    gem 'rails', '5.0.0'
    
  2. Update it to target Rails 5.1.x:
    gem 'rails', '~> 5.1.0'
    
  3. Run this terminal command to update Rails and its dependencies:
    bundle update rails
    
  4. Restart Puma, and you’ll be all set to follow the tutorial as intended.

Either approach will fix the error—pick whichever fits your workflow best!

内容的提问来源于stack exchange,提问作者user2196452

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:30:11