2016-04-23 34 views
34

starałem się zainstalować wtyczkę vbguest włóczęgę, ale mam następujące błędy w terminalu:Nie można zainstalować Vagrant wtyczek w 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>' 

Używam wirtualnej Box 5.0.18_Ubuntu r106667 i Ruby 2.3.0p0. Miałem także ten sam problem, próbując zainstalować wtyczkę sahara. Jak mogę to naprawić?

+0

jest to znany problem już w niektórych postach Githuba. Myślę, że na razie jedynym rozwiązaniem jest zainstalowanie ich ręcznie –

Odpowiedz

2

mam ten sam błąd z innej wtyczki: vagrant-triggers

znalazłem poprawkę do stosowania na /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb.

ale tak, włóczęga wejść w dużej pętli i spróbuj nieskończenie, aby zainstalować pakiet.

56

Tak, istnieje problem: https://github.com/mitchellh/vagrant/issues/7073 w Vagrant 1.8.1

PR FIX: https://github.com/mitchellh/vagrant/pull/7198

Rozwiązaniem powinna być wydana w Vagrant 1.8.2.


Ale do tego czasu możesz załatać to ręcznie.

Oto kroki, aby naprawić Vagrant 1.8.1 pod Ubuntu 16.04, który ma ruby 2.3.0.

1.) Utwórz plik vagrant-plugin.patch z 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.) Zastosuj poprawkę:

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

który naprawia /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb.

+0

Po zastosowaniu łaty, dostaję błędy na vagrant się i vagrant zatrzymać http://pastebin.com/L2KwZ9iU, wszelkie pomysły? –

+1

vagrant 1.8.3 problem nadal istnieje https://github.com/mitchellh/vagrant/issues/7422 –

+0

Nigdy nie wiedziałem o komendzie 'łatki', to jest świetne! Dzięki za poprawkę! – mVChr

15

Zamiast łatania, naprawiłem ten problem stosując Vagrant v1.8.0 w Ubuntu 16.04:

  • pobierania pakietu: 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

pilnować i uaktualnienia do wersji 1.8.2, kiedy zostanie wydana ... Ciesz się!

7

Naprawiono to w najnowszej wersji Vagrant, więc należy ją zaktualizować.

Jeśli nie można uruchomić tego polecenia, aby rozwiązać ten problem:

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

Uwaga: Pozwolenie sudo prowadzony jest wymagane lub bez jako root.

Spowoduje to patch Twojego pliku bundler.rb zgodnie z PR (#7198).

Należy również uaktualnić bundler przynajmniej 1.12.5 co za tym włóczęgi PR (#7404):

sudo gem install bundler --version ">= 1.12.5" 
Powiązane problemy