Blob Blame History Raw
From 068df794f81fb7ec410595d85ca9b4841a6034ec Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Thu, 7 May 2020 22:40:54 +0200
Subject: [PATCH] Do not activate gems if gemspec is not found

---
 lib/vagrant/bundler.rb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb
index 92ee53a..cf92ff7 100644
--- a/lib/vagrant/bundler.rb
+++ b/lib/vagrant/bundler.rb
@@ -622,14 +622,14 @@ module Vagrant
       if !self_spec
         @logger.warn("Failed to locate activated vagrant specification. Activating...")
         self_spec = Gem::Specification.find { |s| s.name == "vagrant" }
-        if !self_spec
-          @logger.error("Failed to locate Vagrant RubyGem specification")
-          raise Vagrant::Errors::SourceSpecNotFound
-        end
+        if self_spec
         self_spec.activate
         @logger.info("Activated vagrant specification version - #{self_spec.version}")
+        end
       end
+      if self_spec
       self_spec.runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list }
+      end
       # discover all the gems we have available
       list = {}
       directories = [Gem::Specification.default_specifications_dir]
-- 
2.25.0