Fehler bei der Ausführung des Laravel-Vagrant-Befehls (Details zum Fehlerbericht enthalten)
滿天的星座
滿天的星座 2017-05-16 16:50:06
0
1
579

Was ist passiert

Vor einiger Zeit habe ich Laravel gelernt und ein Homestead auf MAC (Sierra Version 10.12) installiert. Alles hat gut funktioniert. Führen Sie es einfach nach einem bestimmten Start aus. homestead up 就报错了,执行homestead status 也是报错,而且报错内容一样
但是我执行 homestead --versionhomestead edit 就没问题
于是我就想是不是 homestead 环境出问题了 ,于是我执行
vagrant box remove laravel/homestead
想把 homestead 删除重装。但是 vagrant 也报错了。于是我就想是不是 vagrant 出问题了 于是我想把vagrant 删了 于是我执行 vagrant destroyEs wird immer noch ein Fehler gemeldet

Die Fehlermeldung lautet wie folgt

Beim Ausführen des Befehls homestead wird der folgende Fehler gemeldet

cottondeMacBook-Pro:bin cotton$ homestead up
/opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): mapping values are not allowed in this context at line 2 column 3 (Psych::SyntaxError)
    from /opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:318:in `parse'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:245:in `load'
    from /Users/cotton/.composer/vendor/laravel/homestead/Vagrantfile:20:in `block in <top (required)>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `block in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/vagrantfile.rb:28:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `vagrantfile'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:492:in `host'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:214:in `block in action_runner'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:479:in `hook'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:728:in `unload'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:in `ensure in <main>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:in `<main>'



Beim Ausführen von vagrant lautet die Fehlermeldung wie folgt

cottondeMacBook-Pro:bin cotton$ vagrant box remove laravel/homestead
/opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): mapping values are not allowed in this context at line 2 column 3 (Psych::SyntaxError)
    from /opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:318:in `parse'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:245:in `load'
    from /Users/cotton/.composer/vendor/laravel/homestead/Vagrantfile:20:in `block in <top (required)>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `block in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/vagrantfile.rb:28:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `vagrantfile'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:669:in `machine'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/machine_index.rb:441:in `valid?'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/box_remove.rb:82:in `block (2 levels) in call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/box_remove.rb:82:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/box_remove.rb:82:in `find_all'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/box_remove.rb:82:in `block in call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/box_remove.rb:75:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/box_remove.rb:75:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/commands/box/command/remove.rb:52:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/commands/box/command/root.rb:61:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:308:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:174:in `<main>'

Schließlich habe ich überprüft, wo der Befehl den ersten Fehler gemeldet hat
/opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:370: in `parse': (<unknown>): Mapping-Werte sind in diesem Zusammenhang in Zeile 2, Spalte 3 (Psych::SyntaxError)

nicht zulässig
def self.parse_stream yaml, filename = nil, &block
368     if block_given?
369       parser = Psych::Parser.new(Handlers::DocumentStream.new(&block))
370       parser.parse yaml, filename
371     else
372       parser = self.parser
373       parser.parse yaml, filename
374       parser.handler.root
375     end

Ich verstehe Ruby auch nicht, bitte schauen Sie es sich an

滿天的星座
滿天的星座

Antworte allen(1)
某草草

提示说的意思是你的配置文件有问题,查看一下你的homestead配置文件,是不是配置项附近有什么空格之类的被删除了。

最好的就是你diff看一下配置文件和原版的区别。

这个链接你参考一下,错误提示的行号不一样,所以你要去你自己的配置文件里查。
http://stackoverflow.com/ques...

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage