Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 7.2.1.2 error when running tests #2782

Open
jason-hobbs opened this issue Oct 24, 2024 · 2 comments
Open

Rails 7.2.1.2 error when running tests #2782

jason-hobbs opened this issue Oct 24, 2024 · 2 comments

Comments

@jason-hobbs
Copy link

I just updated to Rails 7.2.1.2 which included an update to rackup 1.0.1. My app runs fine but when trying to run tests with the latest Capybara I am getting:

`#<Thread:0x0000000179b79970 /Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/capybara-3.40.0/lib/capybara/server.rb:76 run> terminated with exception (report_on_exception is true):
/Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.4.3/lib/rack/handler/puma.rb:126:in "module:Handler": undefined method "register" for module Rackup::Handler (NoMethodError)

  register :puma, Puma
  ^^^^^^^^
    from /Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.4.3/lib/rack/handler/puma.rb:120:in "<module:Rackup>"
    from /Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.4.3/lib/rack/handler/puma.rb:119:in "<top (required)>"
    from /Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in "require"
    from /Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in "block (2 levels) in replace_require"
    from /Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in "require"
    from /Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/capybara-3.40.0/lib/capybara/registrations/servers.rb:27:in "block in <top (required)>"
    from /Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/capybara-3.40.0/lib/capybara/config.rb:64:in "block in server="
    from /Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/capybara-3.40.0/lib/capybara/server.rb:77:in "block in boot"

/Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.4.3/lib/rack/handler/puma.rb:6: warning: already initialized constant Puma::RackHandler::DEFAULT_OPTIONS
/Users/jasonhobbs/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.4.3/lib/rack/handler/puma.rb:6: warning: previous definition of DEFAULT_OPTIONS was here`

@edwinwills
Copy link

This is actually an issue that's been fixed in Puma – puma/puma#3532

Until they push a new release, you'll need to pull from HEAD

gem 'puma', github: 'puma/puma'

Hope that helps!

@BrianHawley
Copy link

An alternate workaround would be to add this to Gemfile until the puma release with the bugfix comes out:

gem "rackup", "1.0.0", require: false # work around puma rack integration bug

That will restore the old behavior of the two bugs canceling each other out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants