宅基地流浪汉错误

Gor*_*ler 4 vagrant homestead

/Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:169:in `+': no implicit conversion of nil into String (TypeError)
    from /Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:169:in `block (2 levels) in configure'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/kernel_v2/config/vm_provisioner.rb:72:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/kernel_v2/config/vm_provisioner.rb:72:in `add_config'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/kernel_v2/config/vm.rb:324:in `provision'
    from /Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:168:in `block in configure'
    from /Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:157:in `each'
    from /Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:157:in `configure'
    from /Users/shaddeler/Developer/run/Homestead/Vagrantfile:30: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>'
Run Code Online (Sandbox Code Playgroud)

我无所适从时遇到了这个错误

Abd*_*mad 9

我也有这个问题。我没有错误地缩进,而是不小心在Homestead.yaml文件中添加了另一个破折号(-)。

例如,这是不正确的:

- map: testing.khc.my
- to: /home/vagrant/code/testing/public
Run Code Online (Sandbox Code Playgroud)

在正确的一个是这样的:

- map: testing.khc.my
  to: /home/vagrant/code/testing/public
Run Code Online (Sandbox Code Playgroud)

希望这对以后的所有人有所帮助。


Ann*_*ine 5

我也遇到了这个错误,这真的很痛苦。问题的根源是 Homestead.yaml 文件中的错误缩进。检查您使用的是空格还是制表符。