启动 vagrant 时,报错:psych.rb:456:in `parse’: (): found a tab character that violates indentation while scanning a plain scalar at line 10 column 7 (Psych::SyntaxError)
1、启动 vagrant 时,报错:D:/Program Files/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:456:in `parse’: (): found a tab character that violates indentation while scanning a plain scalar at line 10 column 7 (Psych::SyntaxError)。如图1
Administrator@PC MINGW64 ~/Homestead (v13.2.1) $ vagrant up D:/Program Files/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:456:in `parse': (<unknown>): found a tab character that violates indentation while scanning a plain scalar at line 10 column 7 (Psych::SyntaxError) from D:/Program Files/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:456:in `parse_stream' from D:/Program Files/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:390:in `parse' from D:/Program Files/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:277:in `load' from C:/Users/Administrator/Homestead/Vagrantfile:29:in `block in <top (required)>' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/v2/loader.rb:37:in `load' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:119:in `each' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:119:in `block in load' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:116:in `each' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:116:in `load' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/vagrantfile.rb:29:in `initialize' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:793:in `new' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:793:in `vagrantfile' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:974:in `process_configured_plugins' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:178:in `initialize' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant:194:in `new' from D:/Program Files/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant:194:in `<main>'
2、在 PhpStorm 中查看文件 ~/Homestead/Homestead.yaml,发现有下划红色波浪线提示。原因可能在于之前使用 EditPlus 编辑过。如图2
3、决定重新格式化文件 ~/Homestead/Homestead.yaml。如图3
4、格式化后,不再有下划红色波浪线提示。如图4
5、再次启动 vagrant 时,不再报错。
近期评论