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:
parent
c87cff225f
commit
95aaa99f37
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue