Vagrant Fix: `parse’: (<unknown>): found a tab character that violate intendation while scanning a plain scalar

In case you haven’t heard, I have move my PHP development from XAMPP to Vagrant, Laravel homestead box to be precise. A post on getting started with vagrant coming soon.

As always whilst starting a new project, i added the site to Homestead.yaml, did Vagrant up and got the following error messages.


c:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): found a tab character that violate intendation while scanning a plain scalar at line 18 column 11 (Psych::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/collizo4sky/Desktop/Code/Homestead/Vagrantfile:17:in `block in <top (required)>'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/loader.rb:37:in `call'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/loader.rb:37:in `load'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:103:in `block (2 levels) in load'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:97:in `each'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:97:in `block in load'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:94:in `each'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:94:in `load'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:28:in `initialize'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:691:in `new'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:691:in `vagrantfile'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:441:in `host'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:207:in `block in action_runner'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:33:in `call'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:33:in `run'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:428:in `hook'
        from c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:673:in `unload'
        from c:/HashiCorp/Vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/bin/vagrant:177:in `ensure in <main>'
        from c:/HashiCorp/Vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/bin/vagrant:177:in `<main>'
Solution

Vagrant parser doesn’t play nice with tab indentation thus, the message whilst parsing Homestead.yaml.

The end of the error second line output the line number that contain the tab. Replace the tab with spaces and the problem will be solved.

If error persist, open the Homestead.yaml file in Notepad++ or any editor / IDE of your choice, do a search for \t and replace every instances of tabs with spaces.

Don’t miss out!
Subscribe to My Newsletter
Invalid email address