From 91018d4edca0ff3c2796f17443599bf59908450c Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Tue, 8 May 2018 13:52:23 -0700 Subject: [PATCH] Remove existing items from request set prior to installation --- lib/vagrant/bundler.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index aa76b889c..301e40e37 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -303,6 +303,15 @@ module Vagrant solution = request_set.resolve(installer_set) activate_solution(solution) + # Remove gems which are already installed + request_set.sorted_requests.delete_if do |activation_req| + rs_spec = activation_req.spec + if vagrant_internal_specs.detect{|ispec| ispec.name == rs_spec.name && ispec.version == rs_spec.version } + @logger.debug("Removing activation request from install. Already installed. (#{rs_spec.spec.full_name})") + true + end + end + @logger.debug("Installing required gems.") # Install all remote gems into plugin path. Set the installer to ignore dependencies