From 282dadf784bc4bd2e5e610bd5eaac0699250804e Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Mon, 8 Mar 2021 15:58:47 -0800 Subject: [PATCH] When not running inside bundler, only use specifications that are activated --- lib/vagrant/bundler.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index 7abc01a97..85f9feb57 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -287,7 +287,6 @@ module Vagrant # Never allow dependencies to be remotely satisfied during init request_set.remote = false - repair_result = nil begin @logger.debug("resolving solution from available specification set") # Resolve the request set to ensure proper activation order @@ -656,10 +655,16 @@ module Vagrant spec_dir = Gem::Specification.default_specifications_dir end directories = [spec_dir] - Gem::Specification.find_all{true}.each do |spec| - list[spec.full_name] = spec + if Vagrant.in_bundler? + Gem::Specification.find_all{true}.each do |spec| + list[spec.full_name] = spec + end + else + Gem::Specification.find_all(&:activated?).each do |spec| + list[spec.full_name] = spec + end end - if(!Object.const_defined?(:Bundler)) + if Vagrant.in_installer? directories += Gem::Specification.dirs.find_all do |path| !path.start_with?(Gem.user_dir) end