vagrant upしたらエラーが出た
gitbash
vagrant up
前提
・Windows10
・Vagrant 2.2.19
vagrant upするとエラー
gitbash
vagrant up
C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:456:in `parse': (<unknown>): did not find expected key while parsing a block mapping at line 13 column 5 (Psych::SyntaxError)
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:456:in `parse_stream'
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:390:in `parse'
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:277:in `load'
from C:/TheCode/homesteadTest/Homestead/Vagrantfile:29:in `block in <top (required)>'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/v2/loader.rb:37:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:119:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:119:in `block in load'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:116:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:116:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/vagrantfile.rb:29:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:793:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:793:in `vagrantfile'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:974:in `process_configured_plugins'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:178:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant:194:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant:194:in `<main>'
解決方法
なんか色々とエラーが出ているが、原因は他のところにある。
Homestead.yamlを編集した時にうっかり、インデントがズレてしまったのが原因。
↓ foldersの方のmap:にスペース2つ分のインデントズレがあるので、sites:と揃える。
Homestead.yaml
folders:
- map: C:\Hoge\Homestead\Laravel
to: /home/vagrant/code
sites:
- map: homestead.test
to: /home/vagrant/code/Laravel/public
vagrant upしてみる
gitbash
vagrant up
Bringing machine 'homestead' up with 'virtualbox' provider...以下略
私の環境ではうまくいきました。