Homestead vagrant up错误

时间:2017-02-25 01:06:15

标签: 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>'

我在流浪汉时加入了这个错误

2 个答案:

答案 0 :(得分:5)

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

例如,这是不正确的一个:

- map: testing.khc.my
- to: /home/vagrant/code/testing/public

正确是这样的:

- map: testing.khc.my
  to: /home/vagrant/code/testing/public

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

答案 1 :(得分:4)

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