いろんな記事見てたどり着いた答えを書いてく
環境
- Homestead
- Vagrant2.2.5
- Laravel5.7
現象
自分の環境でvagrant up
した時に以下のエラーが出た
Vagrant failed to initialize at a very early stage:
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.
Path: /Users/namizato/app/Sample/Vagrantfile
Line number: 0
Message: LoadError: cannot load such file -- /Users/namizato/app/Sample/vendor/laravel/homestead/scripts/homestead.rb
どうやらhomestead.rb
がないと言われてるようだった。
試したこと
上記のエラー文を検索したら一番最初に出てきた先輩の記事
【Vagrant】vagrant upするとエラーが発生するようになったので修正しました、という軌跡
Vagrantをバージョンアップしてもダメなら下記を試したらいけたとのこと。
vagrant plugin expunge --reinstall
しかし自分の環境じゃ変わらず。。
ComposerのUpdate
次はcomposer update
をしたら直ったよ!という記事があったので試してみる。
composer update
.....自分の環境じゃダメだった。。
Composerを入れ直す
とりあえずComposer入れ直してみるか。。くらいのつもりでやる
composer require laravel/homestead --dev
vagrant up
.....イケた!?!?
という事でcomposerを入れ直したらいけました。。なぜかは分かりませんが、原因わかる人いたらコメントください( ;∀;)