vagrant box add box名でエラーになる

vagrant box add box名でエラーになる

Vagrantのboxをaddしたらエラーになりました。その対応をしたので記録しておきます。

これが参考になれば何よりです。

問題のエラーとそのコマンド

$ vagrant box add box_name box_name.box
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 'sahara (> 0)'

vagrantのプラグインの再インストールすれば直るよ的なメッセージなのでしょうか。

とりあえず表示されたコマンド(vagrant plugin expunge –reinstall)を叩いてみます。

$ 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? [Y/N]:y

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

Vagrant will now attempt to reinstall user plugins that were removed.
Installing the 'sahara' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

Unable to resolve dependency: user requested 'sahara (> 0)'

どうやら再インストール出来たようです。

 

再びboxをaddしてみます。

$ vagrant box add box_name box_name.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'box_name' (v0) for provider:
 box: Unpacking necessary files from: file://c:/User/test.box
 box:
==> box: Successfully added box 'box_name' (v0) for 'virtualbox'!

成功したようです。

 

この後、

$ vagrant init box_name
$ vagrant up

で無事vagrantが立ち上がりました。完

他のVagrantの記事一覧

https://normalblog.net/system/category/vagrant/

Comments

No comments yet. Why don’t you start the discussion?

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です