Restore the original environment from Bundler and the installer if given

This commit is contained in:
Seth Vargo 2015-07-09 12:36:57 -06:00
parent d8d5a66fa5
commit 3ba10b43ab
1 changed files with 9 additions and 0 deletions

View File

@ -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|