config icon indicating copy to clipboard operation
config copied to clipboard

Vagrant up error - psch.rb:370: found character that cannot start any token while scanning for the next token

Open henry9162 opened this issue 8 years ago • 5 comments

I am desperately in need of help please. After installing vagrant, virtual box, and initialising Homestead, when i run the vagrant up command it feeds back an error -- C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse': (): found character that cannot start any token while scanning for the next token at line 25 column 1 (Psych::SyntaxError).

i have checked other solutions to this that worked for some people, solutions likes replacing TAB with spaces, but all to know avail, please anyone HELP!!!..its been 4days already ... the complete error message is shown below..

C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 25 column 1 (Psych::SyntaxError) from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:inparse_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:inload' from C:/Users/Ekwonwa Henry/Homestead/Vagrantfile:25:in block in <top (required)>' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/config/v2/loader.rb:37:incall' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/config/v2/loader.rb:37:in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/config/loader.rb:113:inblock (2 levels) in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/config/loader.rb:107:in each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/config/loader.rb:107:inblock in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/config/loader.rb:104:in each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/config/loader.rb:104:inload' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/vagrantfile.rb:28:in initialize' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:740:innew' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:740:in vagrantfile' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:486:inhost' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:208:in block in action_runner' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:33:incall' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:33:in run' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:473:inhook' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:722:in unload' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/bin/vagrant:177:inensure in

' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/bin/vagrant:177:in `
'

MY Homestead.yaml file is shown below..


ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys: - ~/.ssh/id_rsa

folders: - map: ~/web/sites to: /home/vagrant/Code/sites

sites: - map: test.app to: /home/vagrant/sites/test

databases: - homestead

I am using windows 8.1

The psch.rb file is very large, but line 370 is where the yaml file was parsed == parser.parse yaml, filename.

while line 25 in the error messages turns out to be just a comment that says === # and emitting capabilities. In addition to wrapping libyaml, Psych also.

henry9162 avatar Aug 15 '16 12:08 henry9162

Same problem here. On Ubuntu 14.04 . . .

Has it been two months and four days now?

Okay. My "vagrant up" command just started working after I read http://stackoverflow.com/questions/15984384/rubies-ruby-2-0-0-p0-lib-ruby-2-0-0-psych-rb205in-parse-unknown-could

My .yaml file did not have a blank line at the end. Added that; saved it; and "vagrant up" started to work.

hraP93SZrh avatar Oct 17 '16 23:10 hraP93SZrh

I had this problem when I had a tab in the yaml file, replaced with spaces and all fine.

richp10 avatar Mar 25 '17 12:03 richp10

Thanks @richp10

8ivek avatar Mar 02 '18 03:03 8ivek

Same error, solved with a blank line at the end of Homestead.yaml and with spaces instead of tab. :)

davpirelli avatar Dec 11 '19 14:12 davpirelli

Muchas gracias, eso era exactamente, los espacios en las areas que había modificado.

nestor0nr avatar Oct 09 '20 16:10 nestor0nr