1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

gem `puma`を6.0にアップグレードすると`capybara` の初期化で`NoMethodError: undefined method `strings' for Puma::Events:Class`エラーが発生する問題の対処法

Posted at

結論

puma6.0以上で動作する場合capybara3.38.0以上のバージョンが必要です

詳細

1. 元々pumaの実装でPuma::Eventsクラスは以下の2つの異なる責務を担っており責務過多だった

  • ロギング
  • コールバックイベントの管理

2. 上記の2つをそれぞれのclassに分離するBreaking changeが入るリファクタリングを行い6.0でリリース

3. capybaraで``Puma::Events`を参照していたが上記の変更の影響を受けてエラーが発生

Failure/Error: events = conf.options[:Silent] ? ::Puma::Events.strings : ::Puma::Events.stdio
            
NoMethodError:
  undefined method `strings' for Puma::Events:Class

    events = conf.options[:Silent] ? ::Puma::Events.strings : ::Puma::Events.stdio
                                                   ^^^^^^^^
# ruby/3.1.0/gems/capybara-3.37.1/lib/capybara/registrations/servers.rb:32:in `block in <main>'
# ruby/3.1.0/gems/capybara-3.37.1/lib/capybara/config.rb:64:in `block in server='
# ruby/3.1.0/gems/capybara-3.37.1/lib/capybara/server.rb:77:in `block in boot'
# 
#   Showing full backtrace because every line was filtered out.
#   See docs for RSpec::Configuration#backtrace_exclusion_patterns and
#   RSpec::Configuration#backtrace_inclusion_patterns for more information.

4. capybaraで対応がされて3.38.0でリリース

その他

puma 6.0 のupgrade用ドキュメント

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?