作者:迷人的哈喽柯柯_458 | 来源:互联网 | 2023-06-30 11:37
Iwastryingtoinstallvagrantpluginvbguest,butgotfollowingerrorsinterminal:我在尝试安装流浪者插件vbg
I was trying to install vagrant plugin vbguest
, but got following errors in terminal:
我在尝试安装流浪者插件vbguest,但是在终端有以下错误:
$ 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 `'
I am using Virtual Box 5.0.18_Ubuntu r106667 and ruby 2.3.0p0. I also faced the same problem trying to install sahara
plugin. How can I fix it?
我使用的是Virtual Box 5.0.18_Ubuntu r106667和ruby 2.3.0p0。我也遇到了同样的问题,试图安装撒哈拉的插件。我怎样才能修好它呢?
5 个解决方案
62
Yes, there is an issue: https://github.com/mitchellh/vagrant/issues/7073 in Vagrant 1.8.1
是的,有一个问题:https://github.com/mitchellh/vagrant/issues/7073 in Vagrant 1.8.1
PR with fix: https://github.com/mitchellh/vagrant/pull/7198
公关与修复:https://github.com/mitchellh/vagrant/pull/7198
The fix should be released in Vagrant 1.8.2
.
修正应该在Vagrant 1.8.2中释放。
But until that you can patch it manually.
但在此之前,您可以手动修补它。
Here are the steps to fix Vagrant 1.8.1
under Ubuntu 16.04
which has ruby 2.3.0
.
下面是在Ubuntu 16.04下修复流浪1.8.1的步骤,它有ruby 2.3.0。
1.) Create file vagrant-plugin.patch
with the following contents:
1)。vagrant-plugin创建文件。贴片内容如下:
---
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.) Apply patch:
2)。应用补丁:
sudo patch --directory /usr/lib/ruby/vendor_ruby/vagrant
which fixes /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb
.
修复/usr/lib/ruby/vendor_ruby /漂泊者/ bundler.rb。