diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 938b4a9ac..f78dd9b63 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -428,6 +428,10 @@ module Vagrant error_key(:plugin_gem_error) end + class PluginGemNotFound < VagrantError + error_key(:plugin_gem_not_found) + end + class PluginInstallBadEntryPoint < VagrantError error_key(:plugin_install_bad_entry_point) end diff --git a/lib/vagrant/plugin/manager.rb b/lib/vagrant/plugin/manager.rb index 3986f1b79..7c67d4372 100644 --- a/lib/vagrant/plugin/manager.rb +++ b/lib/vagrant/plugin/manager.rb @@ -40,6 +40,8 @@ module Vagrant @global_file.add_plugin(result.name) result + rescue ::Bundler::GemNotFound + raise Errors::PluginGemNotFound, name: name end # Uninstalls the plugin with the given name. diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 7a4679e00..c8c900375 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -474,6 +474,9 @@ en: manage Vagrant plugins. The output of the errors are shown below: %{output} + plugin_gem_not_found: |- + The plugin '%{name}' could not be installed because it could not + be found. Please double check the name and try again. plugin_install_bad_entry_point: |- Attempting to load the plugin '%{name}' failed, because the entry point doesn't exist. The entry point attempted was