From 3ba10b43abda41a433356b496757abe64f6c31cb Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Thu, 9 Jul 2015 12:36:57 -0600 Subject: [PATCH] Restore the original environment from Bundler and the installer if given --- lib/vagrant/util/subprocess.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index e249b72c1..e610151d2 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -91,6 +91,15 @@ module Vagrant end end + # Reset the Bundler environment back - this is required for anyone who + # is not using the official Vagrant installers and is running Vagrant + # via bundler + if defined?(Bundler::ORIGINAL_ENV) + Bundler::ORIGINAL_ENV.each do |k, v| + process.environment[k] = v + end + end + # Set the environment on the process if we must if @options[:env] @options[:env].each do |k, v|