aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/app_base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators/app_base.rb')
-rw-r--r--railties/lib/rails/generators/app_base.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 3778690ef6..8df2b32dd2 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -388,19 +388,21 @@ module Rails
# its own vendored Thor, which could be a different version. Running both
# things in the same process is a recipe for a night with paracetamol.
#
- # We unset temporary bundler variables to load proper bundler and Gemfile.
- #
# Thanks to James Tucker for the Gem tricks involved in this call.
_bundle_command = Gem.bin_path("bundler", "bundle")
require "bundler"
- Bundler.with_clean_env do
- full_command = %Q["#{Gem.ruby}" "#{_bundle_command}" #{command}]
- if options[:quiet]
- system(env, full_command, out: File::NULL)
- else
- system(env, full_command)
- end
+ Bundler.with_original_env do
+ exec_bundle_command(_bundle_command, command, env)
+ end
+ end
+
+ def exec_bundle_command(bundle_command, command, env)
+ full_command = %Q["#{Gem.ruby}" "#{bundle_command}" #{command}]
+ if options[:quiet]
+ system(env, full_command, out: File::NULL)
+ else
+ system(env, full_command)
end
end