diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index 7a903a2cc5e..1773081deab 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -205,7 +205,7 @@ def with_isolated_gem # native extensions because it causes all sorts of problems. old_rubyopt = ENV["RUBYOPT"] old_gemfile = ENV["BUNDLE_GEMFILE"] - ENV["BUNDLE_GEMFILE"] = nil + ENV["BUNDLE_GEMFILE"] = Tempfile.new("vagrant-gemfile").path ENV["RUBYOPT"] = (ENV["RUBYOPT"] || "").gsub(/-rbundler\/setup\s*/, "") # Set the GEM_HOME so gems are installed only to our local gem dir