2015-06-21 101 views
0

我爲安裝宅基地Laravel 5(Windows)中錯誤宅基地了

我已經安裝了流浪VirtualBox的

按照本教程:https://laracasts.com/lessons/say-hello-to-laravel-homestead-two

當我運行 宅基地up

這是錯誤re SULT:

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 

回答

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 
+0

謝謝你,我只是想通了這一點。我也嘗試刪除所有包含「#」的行。 –