カテゴリー
Apple

【Vagrant】アップデート直後に使えなくなったエラーを解決した記録

環境

  • macOS Sierra
  • macOS 10.12.2 (16C67)
  • Vagrant 1.9.1

エラー内容

$ vagrant 
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

Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-vbguest (> 0)'
$ 

エラー原因

  • エラーメッセージ通り、Vagrant のプラグイン関係のエラー
  • プラグインをインストールした状態で Vagrant をアップデートしたことが原因と思われる。

エラー対処

エラーメッセージにある通り vagrant plugin repair を試しましたの♪

$ vagrant plugin repair
Repairing currently installed plugins. This may take a few minutes...
Fetching: micromachine-2.0.0.gem (100%)
Fetching: vagrant-cachier-1.2.1.gem (100%)
Fetching: vagrant-vbguest-0.13.0.gem (100%)
Installed plugins successfully repaired!
$ 

修復できたかを確認

$ mkdir vtest
$ cd vtest/
$ vagrant init oki2a24/centos-7-x86_64; vagrant up
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'oki2a24/centos-7-x86_64' could not be found. Attempting to find and install...
... 略 ...
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/username/vtest

おわりに

もっと問題解決に時間がかかると思ったのですけれども、エラーメッセージで促されたコマンドの実行だけで解決することができました♪

ほっとしましたわ♪

以上です。

コメントを残す