LoginSignup
27
16

More than 3 years have passed since last update.

laravel homesteadをインストールしようとしたらできなかった話

Posted at

Laravel homesteadをインストールしようとした

ちょっと所用でlaravelのテスト環境がほしくなったため、vagrantで環境を作ろうと思った。
何度かvagrantで環境をつくってはいるものの、トリアタマなため、調べながらコマンドをぽちぽち…。

すると、エラーが出てインストールできなかった。

$ vagrant up
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Box 'laravel/homestead' could not be found. Attempting to find and install...
    homestead: Box Provider: virtualbox
    homestead: Box Version: >= 9.0.0
==> homestead: Loading metadata for box 'laravel/homestead'
    homestead: URL: https://vagrantcloud.com/laravel/homestead
==> homestead: Adding box 'laravel/homestead' (v9.1.0) for provider: virtualbox
    homestead: Downloading: https://vagrantcloud.com/laravel/boxes/homestead/versions/9.1.0/providers/virtualbox.box
    homestead: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com
    homestead: Calculating and comparing box checksum...
The specified checksum type is not supported by Vagrant: sha512.
Vagrant supports the following checksum types:

md5, sha1, sha256

????🤔

checksumがちがうらしい

The specified checksum type is not supported by Vagrant: sha512.
Vagrant supports the following checksum types:

md5, sha1, sha256

ここの部分。指定されたチェックサムは sha512 だけど、vagrantがサポートしてるのは以下のとおりだよ、と言われていました。
…じゃあどうすれば????

全く同じことを思ってる人がいました。
https://stackoverflow.com/questions/59133168/laravel-homestead-vagrant-box-error-the-specified-checksum-type-is-not-support

ちなみにここでも動かない!って言ってた
https://github.com/laravel/homestead/issues/1325

vagrantをアップデートすればいいらしい

質問への回答をみると、どうやら、新しいバージョンはチェックサムのサポートが変わったらしい。
なので、vagrant自体をアップデートすればいいよ!とのこと。
現在の最新バージョンは2.5.6とのこと。
どれどれ…

$ vagrant --version
Vagrant 2.2.5

はい。
パッケージをインストールしてきて、アップデート。

$ vagrant --version
Vagrant 2.2.6

これでいけるでしょう!!!

$ 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: user requested 'vagrant-hostsupdater (= 1.1.1.160)'

次はなんだ。

初期化に失敗したらしい

どうも初期化に失敗したらしい。

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? [N]:

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

Vagrant will now attempt to reinstall user plugins that were removed.
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...
Fetching: vagrant-hostsupdater-1.1.1.160.gem (100%)
Fetching: micromachine-3.0.0.gem (100%)
Fetching: vagrant-vbguest-0.22.1.gem (100%)
Vagrant failed to properly resolve required dependencies. These
errors can commonly be caused by misconfigured plugin installations
or transient network issues. The reported error is:

Unable to resolve dependency: user requested 'vagrant-vbguest (= 0.20.0)'

解決しなかった

vagrantのプラグインもアップデートしよう

vagrant plugin updateしてみて、とも書いてあったので、チャレンジ。

$ vagrant plugin update
Updating installed plugins...
Updated 'vagrant-vbguest' to version '0.22.1'!

ようやく、ここでvagrant upできるようになりました!!

まとめ

checksumのエラーは、日本語のページがなかったので、もしかしたら私のような人がいるかもしれない…と思い、まとめました。
もしかしたらいないかもしれない。

まぁ、ひさびさに使うものは、まずアップデートからしたほうがいいですね!

27
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
27
16