为什么操作系统升级后 Vagrant 会失败?

为什么操作系统升级后 Vagrant 会失败?

多个软件包已升级,如 gem、ruby 及其插件。现在运行时vagrant up我得到:

Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:

  vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:

  vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest
versions:

  vagrant plugin update

Error message given during initialization: Unable to resolve dependency: 'fog-libvirt (>= 0.3.0)' requires 'ruby-libvirt (>= 0.7.0)'

vagrant我甚至删除了整个sudo apt-get remove --purge vagrant但全新安装后仍显示错误。

我尝试重新安装,sudo gem install ruby-libvirt但什么也没发生。

有什么东西可以让我尝试Ubuntu解决这个问题并且开始vagrant行动吗?


编辑-1:

vagrant plugin repair显示:

Repairing currently installed plugins. This may take a few minutes...
Failed to automatically repair installed Vagrant plugins. To fix this
problem remove all user installed plugins and reinstall. Vagrant can
do this for you automatically by running the following command:

  vagrant plugin expunge --reinstall

Failure message received during repair:

Unable to resolve dependency: user requested 'vagrant-libvirt (> 0)

然后使用vagrant plugin expunge --reinstall

This command permanently deletes all currently installed user plugins. It
should only be used when a repair command is unable to properly fix the
system.

Continue? [N]: Y

All user installed plugins have been removed from this Vagrant environment!

Vagrant will now attempt to reinstall user plugins that were removed.

答案1

我删除了ruby&gems以及 vagrant 目录~/.vagrant.d并重新安装了vagrantrubygems。现在一切都正常运行。看来错误与ruby和有关gems

答案2

尝试第二种选择:

vagrant plugin update

我懂了:

Updating installed plugins...
Updated 'vagrant-vbguest' to version '0.31.0'!

一切正常

相关内容