diff --git a/bin/vagrant b/bin/vagrant index 4fc6b96fa..fce68c857 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -68,7 +68,7 @@ end # then also initialize the paths to the plugins. require "bundler" begin - Bundler.setup(:default, :plugins) + $vagrant_bundler_runtime = Bundler.setup(:default, :plugins) rescue Bundler::GemNotFound $stderr.puts "Bundler, the underlying system used to manage Vagrant plugins," $stderr.puts "is reporting that a plugin or its dependency can't be found." diff --git a/lib/vagrant.rb b/lib/vagrant.rb index 3ae4c1154..a84bb1b05 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -288,7 +288,7 @@ end if Vagrant.plugins_enabled? begin global_logger.info("Loading plugins!") - Bundler.require(:plugins) + $vagrant_bundler_runtime.require(:plugins) rescue Exception => e raise Vagrant::Errors::PluginLoadError, message: e.to_s end