You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate an app using rails new with Rails 7.1.0.beta1
Run RAILS_ENV=production bundle exec puma -C ./config/puma.rb
Expected behavior
Puma should start.
Actual behavior
./config/puma.rb:16:in `block in _load_from': uninitialized constant Puma::DSL::Concurrent (NameError)
from ./config/puma.rb:16:in `fetch'
from ./config/puma.rb:16:in `_load_from'
The problem lies in the config/puma.rb file generated by rails new, specifically this statement that was added in #46838:
At the time Puma evals this statement, Bundler.require has not yet been run, and so the concurrent-ruby gem has not yet been loaded. That is why the Concurrent constant is not defined and we see an uninitialized constant error when Puma starts.
Workaround
Set the WEB_CONCURRENCY env var or change the ENV.fetch statement config/puma.rb as follows: