我正在为 Laravel 5 安装家园(Windows)
我已经安装 Vagrant 和 VirtualBox
遵循本教程:https://laracasts.com/lessons/say-hello-to-laravel-homestead-two
我跑的时候 宅基地
这是错误结果:
C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>
): did not find expected key while parsing a block mapping at line 3 column 1 (P
sych::SyntaxError)
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse
_stream'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:153:in `parse
'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:129:in `load'
from C:/Users/Mark/AppData/Roaming/Composer/vendor/laravel/homestead/Vag
rantfile:18:in `block in <top (required)>'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/c
onfig/v2/loader.rb:37:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/c
onfig/v2/loader.rb:37:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/c
onfig/loader.rb:103:in `block (2 levels) in load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/c
onfig/loader.rb:97:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/c
onfig/loader.rb:97:in `block in load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/c
onfig/loader.rb:94:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/c
onfig/loader.rb:94:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/v
agrantfile.rb:28:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/e
nvironment.rb:691:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/e
nvironment.rb:691:in `vagrantfile'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/e
nvironment.rb:441:in `host'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/e
nvironment.rb:207:in `block in action_runner'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/a
ction/runner.rb:33:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/a
ction/runner.rb:33:in `run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/e
nvironment.rb:428:in `hook'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/e
nvironment.rb:673:in `unload'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/bin/vagrant:1
77:in `ensure in <main>'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/bin/vagrant:1
77:in `<main>'
这是我的YAML文件:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Projects
to: /home/vagrant/Projects
sites:
- map: myawesomeproject.app
to: /home/vagrant/Projects/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local#
blackfire:#
- id: foo#
token: bar#
client-id: foo#
client-token: bar#
ports:#
- send: 93000#
to: 9300#
- send: 7777#
to: 777#
protocol: udp
答案 0 :(得分:2)
我认为这是因为#不正确。
它应该像
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Projects
to: /home/vagrant/Projects
sites:
- map: myawesomeproject.app
to: /home/vagrant/Projects/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: udp