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
"bundle exec puma" fails: NoMethodError: undefined method `include?' for nil:NilClass" #1344
Comments
Steps to reproduce or example application would be helpful |
I just ran "bundle exec puma"
env["RUBYOPT"] = [env["RUBYOPT"], bundle].join(" ") unless env["RUBYOPT"].include?(bundle) this code expects RUBYOPT to be always set, when puma is run via bundler, is that a justified assumption? It wasn't set for me. |
What is the result for (in the same dir as
|
I can confirm this issue, if I run |
ruby -v
gem -v
bundle -v
rails -v
puma --version
uname -a |
|
here's the order of relevant events in a
It's not clear to me how this works for anyone, since puma invocation in a sub-shell is not the default behavior of bundle exec. |
minor issue: It's probably better not to mutate Bundler::ORIGINAL_ENV but call Bundler::original_env that clones it, or dup it yourself if the constant predates the method. def run
previous_env =
if defined?(Bundler)
env = Bundler::ORIGINAL_ENV
# add -rbundler/setup so we load from Gemfile when restarting
bundle = "-rbundler/setup"
env["RUBYOPT"] = [env["RUBYOPT"], bundle].join(" ") unless env["RUBYOPT"].include?(bundle)
env
else
ENV.to_h
end |
not sure if you'd want to support this scenario, but if puma is started with |
I can also confirm this issue - after upgrading Puma from 3.8.2 to 3.9.1 I'm not able to start the server without Bundler::ORIGINAL_ENV['RUBYOPT'] ||= ENV['RUBYOPT'] To my config/puma.rb 😄 |
Closed by #1385 |
This reverts commit 853c01d. No longer needed with fix on puma master github: puma/puma#1344 puma/puma#1385
The text was updated successfully, but these errors were encountered: