diff --git a/CHANGELOG.md b/CHANGELOG.md index 910006c7b..e6e2a0c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ IMPROVEMENTS: - More robust SSH connection close detection. + - Don't load `vagrant plugin` installed plugins when in a Bundler + environment. This happens during plugin development. This will make + Vagrant errors much quieter when developing plugins. BUG FIXES: diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 979d7a143..c25e08187 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -636,6 +636,16 @@ module Vagrant ENV["GEM_PATH"] = "#{@gems_path}#{::File::PATH_SEPARATOR}#{ENV["GEM_PATH"]}" ::Gem.clear_paths + # If we're in a Bundler environment, don't load plugins. This only + # happens in plugin development environments. + if defined?(Bundler) + require 'bundler/shared_helpers' + if Bundler::SharedHelpers.in_bundle? + @logger.warn("In a bundler environment, not loading environment plugins!") + return + end + end + # Load the plugins plugins_json_file = @home_path.join("plugins.json") @logger.debug("Loading plugins from: #{plugins_json_file}")