From b209db959a7ef55927e66431689ca87529c1e9b6 Mon Sep 17 00:00:00 2001 From: Michael Grosser Date: Wed, 3 May 2017 10:18:54 -0700 Subject: [PATCH] also forget about BUNDLE_GEMFILE etc settings bundler sets up before loading puma when restarting a symlinked server the BUNDLE_GEMFILE env var will point to the old releases Gemfile ... which results in running gems that do not belong to the current release --- lib/puma/launcher.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puma/launcher.rb b/lib/puma/launcher.rb index 8c6e9724..33938fca 100644 --- a/lib/puma/launcher.rb +++ b/lib/puma/launcher.rb @@ -163,7 +163,7 @@ module Puma # Run the server. This blocks until the server is stopped def run - env = ENV.to_h + previous_env = (defined?(Bundler) ? Bundler.clean_env : ENV.to_h) @config.clamp @@ -180,7 +180,7 @@ module Puma graceful_stop when :restart log "* Restarting..." - ENV.replace(env) + ENV.replace(previous_env) @runner.before_restart restart! when :exit