1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Use with_unbundled_env for Bundler 2.1+ (#2151)

This commit is contained in:
Nate Berkopec 2020-03-06 19:30:26 -06:00 committed by GitHub
parent c87cff225f
commit 95aaa99f37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -299,7 +299,7 @@ module Puma
log '* Pruning Bundler environment'
home = ENV['GEM_HOME']
bundle_gemfile = ENV['BUNDLE_GEMFILE']
Bundler.with_clean_env do
with_unbundled_env do
ENV['GEM_HOME'] = home
ENV['BUNDLE_GEMFILE'] = bundle_gemfile
ENV['PUMA_BUNDLER_PRUNED'] = '1'
@ -473,5 +473,14 @@ module Puma
raise "#{feature} is not supported on your version of RubyGems. " \
"You must have RubyGems #{min_version}+ to use this feature."
end
def with_unbundled_env
bundler_ver = Gem::Version.new(Bundler::VERSION)
if bundler_ver < Gem::Version.new('2.1.0')
Bundler.with_clean_env { yield }
else
Bundler.with_unbundled_env { yield }
end
end
end
end