From 354c1c2b510f667b330323e60945541237a9081a Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 22 Mar 2017 16:36:42 -0700 Subject: [PATCH] Prevent adding local paths to RubyGems sources list --- lib/vagrant/bundler.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index 27a407333..8f3d7aceb 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -248,7 +248,11 @@ module Vagrant @logger.debug("Enabling user defined remote RubyGems sources") all_sources.each do |src| - next if URI.parse(src).scheme.nil? + begin + next if File.file?(src) || URI.parse(src).scheme.nil? + rescue URI::InvalidURIError + next + end @logger.debug("Adding RubyGems source #{src}") Gem.sources << src end