core: reset the specification lookup when isolating gems

This commit is contained in:
Mitchell Hashimoto 2014-01-06 09:27:26 -08:00
parent 677275e43c
commit 3f9fb2ef03
1 changed files with 5 additions and 1 deletions

View File

@ -161,7 +161,10 @@ module Vagrant
# Clear paths so that it reads the new GEM_HOME setting
Gem.paths = ENV
# Set a custom configuration to avoid loading ~/.gemrc loads and
# Reset the all specs override that Bundler does
old_all = Gem::Specification._all
Gem::Specification.all = nil
# /etc/gemrc and so on.
old_config = nil
begin
@ -185,6 +188,7 @@ module Vagrant
Gem.configuration = old_config
Gem.paths = ENV
Gem::Specification.all = old_all
end
# This is pretty hacky but it is a custom implementation of