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

fix #1344 (bundle exec startup without RUBYOPT present) #1348

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/puma/launcher.rb
Expand Up @@ -165,10 +165,16 @@ def phased_restart
def run
previous_env =
if defined?(Bundler)
env = Bundler::ORIGINAL_ENV
env = Bundler::ORIGINAL_ENV.dup
# add -rbundler/setup so we load from Gemfile when restarting
bundle = "-rbundler/setup"
env["RUBYOPT"] = [env["RUBYOPT"], bundle].join(" ") unless env["RUBYOPT"].include?(bundle)

# bundler init ORIGINAL_ENV from ENV before it sets RUBYOPT in ENV, so env["RUBYOPT"] can be nil
if env["RUBYOPT"]
env["RUBYOPT"] = [env["RUBYOPT"], bundle].join(" ") unless env["RUBYOPT"].include?(bundle)
else
env["RUBYOPT"] = bundle
end
env
else
ENV.to_h
Expand Down