Kars Barendrecht Kars Barendrecht - 2 months ago 21
YAML Question

Vagrant up throws parse error

I'm trying to run vagrant using hyper as provider, following this guide.
But when I run 'vagrant up' I get the following error:

$ 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>'


E:/www/Homestead/Vagrantfile:20:in `block in ' gives me reason to believe that this is where there the parse error occurs.

Line 20 from vagrantfile loads homestead.yaml:

Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))


And this is my homestead.yaml.
I've check its validity with http://www.yamllint.com/ , which says it is valid.

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


Why am I getting this error, and how do I fix this error?

Answer

when you see this error, you should look the homestead.yaml file. there is space or enter extra.

 - 
    map: ~/Code

should be :

- map: ~/Code

and

- 
    map: homestead.app

should be :

 - map: homestead.app