尝试 vagrant up 时阻止 windows_hyperv_admin 出错

2024-03-11

我在我的环境中使用 Vagrant,但遇到了一个小问题,如下所示。

kk@Lenovo MINGW64 ~/sravz/vm1
$ vagrant up
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/platform.rb:85:in `block in windows_hyperv_admin?': undefined method `include?' for #<Vagrant::Util::Subprocess::Result:0x2634e88> (NoMethodError)
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/platform.rb:89:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/platform.rb:89:in `windows_hyperv_admin?'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/hyperv/provider.rb:20:in `usable?'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:381:in `block in default_provider'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:379:in `each'

我已经用 vagrant init 初始化了我的项目,但由于某种原因 vagrant up 拒绝工作。


我遇到了同样的问题,正如 @Frédéric Henri 提到的,这与此问题相关:https://github.com/mitchellh/vagrant/issues/7465 https://github.com/mitchellh/vagrant/issues/7465.

我刚刚遵循了其中一条评论中提出的建议,现在工作正常:)

我也遇到了同样的问题(最初以为是因为 Hyper-V,我已经卸载了它,但错误仍然存​​在)。但如果您今天安装了 Virtualbox,则问题可能是因为 5.1 几个小时前刚刚发布(创建环境变量 VAGRANT_DEFAULT_PROVIDER 设置为“virtualbox”会显示一条消息,表示它最多只支持 5.0)。

*卸载 5.1,然后安装 Virtualbox 5.0.x,直到该问题解决为止,这为我解决了问题。

您可以找到较旧的版本here https://www.virtualbox.org/wiki/Download_Old_Builds。对于 5.0.x。具体来说,here https://www.virtualbox.org/wiki/Download_Old_Builds_5_0.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

尝试 vagrant up 时阻止 windows_hyperv_admin 出错 的相关文章

随机推荐