Kar*_*cht 0 yaml hyper-v vagrant vagrantfile
我正在尝试使用hyper作为提供程序运行vagrant,遵循本指南.但当我运行'vagrant up'时,我收到以下错误:
$ vagrant up
C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): found a tab character that violate intendation while scanning a plain scalar at line 21 column 7 (Psych::SyntaxError)
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:318:in `parse'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:245:in `load'
from E:/www/Homestead/Vagrantfile:20:in `block in <top (required)>'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/config/v2/loader.rb:37:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/config/v2/loader.rb:37:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/config/loader.rb:107:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/config/loader.rb:107:in `block in load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/config/loader.rb:104:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/config/loader.rb:104:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/vagrantfile.rb:28:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/environment.rb:740:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/environment.rb:740:in `vagrantfile'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/environment.rb:486:in `host'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/environment.rb:208:in `block in action_runner'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/runner.rb:33:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/runner.rb:33:in `run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/environment.rb:473:in `hook'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/environment.rb:722:in `unload'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/bin/vagrant:177:in `ensure in <main>'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.3/bin/vagrant:177:in `<main>'
Run Code Online (Sandbox Code Playgroud)
E:/ www/Homestead/Vagrantfile:20:在`block in'让我有理由相信这是解析错误发生的地方.
vagrantfile的第20行加载homestead.yaml:
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
Run Code Online (Sandbox Code Playgroud)
这是我的homestead.yaml.我已经通过http://www.yamllint.com/检查了它的有效性,它说它有效.
---
authorize: C:\Users\xxx\.sshid_rsa.pub
box: johnpbloch/homestead
cpus: 1
databases:
- homestead
folders:
-
map: ~/Code
to: /home/vagrant/Code
ip: "192.168.10.10"
keys:
- ~/.ssh/id_rsa
memory: 2048
provider: virtualbox
sites:
-
map: homestead.app
to: /home/vagrant/Code/Laravel/public
Run Code Online (Sandbox Code Playgroud)
为什么我收到此错误,如何解决此错误?
当你看到这个错误时,你应该看看homestead.yaml文件.有空间或进入额外.
-
map: ~/Code
Run Code Online (Sandbox Code Playgroud)
应该 :
- map: ~/Code
Run Code Online (Sandbox Code Playgroud)
和
-
map: homestead.app
Run Code Online (Sandbox Code Playgroud)
应该 :
- map: homestead.app
Run Code Online (Sandbox Code Playgroud)