2016-04-23 11 views
34

stavo cercando di installare plugin di vagabondo vbguest, ma ha ottenuto seguenti errori nel terminale:Impossibile installare plugin vaganti in Ubuntu

$ vagrant plugin install vbguest 
Installing the 'vbguest' plugin. This can take a few minutes... 
/usr/lib/ruby/2.3.0/rubygems/specification.rb:946:in `all=': undefined method `group_by' for nil:NilClass (NoMethodError) 
    from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:275:in `with_isolated_gem' 
    from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:231:in `internal_install' 
    from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:102:in `install' 
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:62:in `block in install_plugin' 
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:72:in `install_plugin' 
    from /usr/share/vagrant/plugins/commands/plugin/action/install_gem.rb:37:in `call' 
    from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call' 
    from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in `call' 
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `block in run' 
    from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy' 
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `run' 
    from /usr/share/vagrant/plugins/commands/plugin/command/base.rb:14:in `action' 
    from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:32:in `block in execute' 
    from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `each' 
    from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `execute' 
    from /usr/share/vagrant/plugins/commands/plugin/command/root.rb:56:in `execute' 
    from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:42:in `execute' 
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:268:in `cli' 
    from /usr/bin/vagrant:173:in `<main>' 

Sto usando Virtual Box 5.0.18_Ubuntu r106667 e rubino 2.3.0p0. Ho anche affrontato lo stesso problema cercando di installare il plugin sahara. Come posso ripararlo?

+0

questo è un problema noto già in alcuni post di github. per ora penso che l'unica soluzione sia installarli manualmente –

risposta

2

ho lo stesso errore con un altro plugin: vagrant-triggers

ho trovato una patch da applicare su /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb.

ma così, vagabondo entrare in un grande ciclo e provare all'infinito per installare il pacchetto.

56

sì, c'è un problema: https://github.com/mitchellh/vagrant/issues/7073 in Vagrant 1.8.1

PR con correzione: https://github.com/mitchellh/vagrant/pull/7198

La correzione dovrebbe essere rilasciato in Vagrant 1.8.2.


Ma fino a quando è possibile patch manualmente.

Ecco i passaggi per correggere Vagrant 1.8.1 sotto Ubuntu 16.04 che ha ruby 2.3.0.

1.) Creare il file vagrant-plugin.patch con the following contents:

--- 
lib/vagrant/bundler.rb | 3 ++- 
1 file changed, 2 insertions(+), 1 deletion(-) 

diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb 
index 5a5c185..c4a3837 100644 
--- a/lib/vagrant/bundler.rb 
+++ b/lib/vagrant/bundler.rb 
@@ -272,7 +272,6 @@ module Vagrant 

     # Reset the all specs override that Bundler does 
     old_all = Gem::Specification._all 
-  Gem::Specification.all = nil 

     # /etc/gemrc and so on. 
     old_config = nil 
@@ -286,6 +285,8 @@ module Vagrant 
     end 
     Gem.configuration = NilGemConfig.new 

+  Gem::Specification.reset 
+ 
     # Use a silent UI so that we have no output 
     Gem::DefaultUserInteraction.use_ui(Gem::SilentUI.new) do 
    return yield 

2.) applicare la patch:

sudo patch --directory /usr/lib/ruby/vendor_ruby/vagrant < vagrant-plugin.patch 

che fissa /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb.

+0

Dopo aver applicato la patch, sto ricevendo errori su vagabondo e arresto vago http://pastebin.com/L2KwZ9iU, qualche idea? –

+1

vagabondo 1.8.3 il problema è ancora lì https://github.com/mitchellh/vagrant/issues/7422 –

+0

Mai saputo del comando 'patch', è bello! Grazie per la correzione! – mVChr

15

Invece di patch, ho risolto il problema utilizzando v1.8.0 vagabondo in Ubuntu 16.04:

  • Scarica pacchetto: wget https://releases.hashicorp.com/vagrant/1.8.0/vagrant_1.8.0_x86_64.deb
  • sudo dpkg -i vagrant_1.8.0_x86_64.deb
  • vagrant plugin install vagrant-vbguest

Tenete d'occhio e aggiornamento a 1.8.2 quando viene rilasciato ... Divertiti!

7

Questo è stato risolto nella versione più recente di Vagrant, quindi aggiornarlo.

Se non è possibile, eseguire questo comando per risolvere il problema:

sudo sed -i'' "s/Specification.all = nil/Specification.reset/" /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb 

Nota: L'autorizzazione sudo è richiesta o eseguito senza come una radice.

Questo patch il tuo file bundler.rb come da PR (#7198).

Si dovrebbe anche aggiornare il tuo bundler almeno a 1.12.5 di cui al presente vagabondo PR (#7404):

sudo gem install bundler --version ">= 1.12.5"