diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index 785f74f27..ea9639566 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -65,6 +65,9 @@ module Vagrant end definition.specs + rescue ::Bundler::VersionConflict => e + raise Errors::PluginInstallVersionConflict, + conflicts: e.to_s.gsub("Bundler", "Vagrant") end # Clean removes any unused gems. diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index a4fd6090b..938b4a9ac 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -440,6 +440,10 @@ module Vagrant error_key(:plugin_install_not_found) end + class PluginInstallVersionConflict < VagrantError + error_key(:plugin_install_version_conflict) + end + class PluginLoadError < VagrantError error_key(:plugin_load_error) end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index e02c1c30c..7a4679e00 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -486,6 +486,16 @@ en: plugin_install_not_found: |- The plugin '%{name}' could not be found in local or remote repositories. Please check the name of the plugin and try again. + plugin_install_version_conflict: |- + The plugin(s) can't be installed due to the version conflicts below. + This means that the plugins depend on a library version that conflicts + with other plugins or Vagrant itself, creating an impossible situation + where Vagrant wouldn't be able to load the plugins. + + You can fix the issue by either removing a conflicting plugin or + by contacting a plugin author to see if they can address the conflict. + + %{conflicts} plugin_load_error: |- The plugin "%{plugin}" could not be found. Please make sure that it is properly installed via `vagrant plugin`. Note that plugins made for