summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorTim Bates <tbates@redarc.com.au>2023-01-24 16:53:00 +1030
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-01-31 10:49:08 +0900
commit369ed03cd4915dd751b1c5dc1f8cae73bdc0702d (patch)
treea4b7790418a22c6bb3baaddaaa770b2a34d546e5 /lib/bundler
parent70eedef32aa3e6f2a95fee7ce2582c247d274e90 (diff)
[rubygems/rubygems] Fix issue with extensions not compiling properly using inline gemfile
https://github.com/rubygems/rubygems/commit/fa6e6ea95c
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7203
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/inline.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
index 6664d3ebc4..855ae5526a 100644
--- a/lib/bundler/inline.rb
+++ b/lib/bundler/inline.rb
@@ -38,9 +38,8 @@ def gemfile(install = false, options = {}, &gemfile)
Bundler.ui = ui
raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
- begin
+ Bundler.with_unbundled_env do
Bundler.instance_variable_set(:@bundle_path, Pathname.new(Gem.dir))
- old_gemfile = ENV["BUNDLE_GEMFILE"]
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
@@ -65,11 +64,9 @@ def gemfile(install = false, options = {}, &gemfile)
runtime = Bundler::Runtime.new(nil, definition)
runtime.setup.require
end
- ensure
- if old_gemfile
- ENV["BUNDLE_GEMFILE"] = old_gemfile
- else
- ENV["BUNDLE_GEMFILE"] = ""
- end
+ end
+
+ if ENV["BUNDLE_GEMFILE"].nil?
+ ENV["BUNDLE_GEMFILE"] = ""
end
end