添加新网站后宅基地流浪汉破碎

时间:2017-04-26 00:29:30

标签: vagrant homestead

我的流浪盒子里有一个奇怪的问题。我不是很熟悉流浪汉。只是想检查一下是否有人解决了同样的问题,或者至少可以为我解释一下。在此先感谢您的帮助!

该框工作正常,直到我添加了一个新的laravel网站。(我没有改变任何东西来自vagrantfile。只添加了为新网站maping的网站)在作曲家安装后,我试图重新加载流浪盒。然后我得到错误:

Bins:homestead Leo$ vagrant reload
/Applications/MAMP/htdocs/homestead/vendor/laravel/homestead/scripts/homestead.rb:178:in `+': no implicit conversion of nil into String (TypeError)
    from /Applications/MAMP/htdocs/homestead/vendor/laravel/homestead/scripts/homestead.rb:178:in `block (2 levels) in configure'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/kernel_v2/config/vm_provisioner.rb:72:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/kernel_v2/config/vm_provisioner.rb:72:in `add_config'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/kernel_v2/config/vm.rb:338:in `provision'
    from /Applications/MAMP/htdocs/homestead/vendor/laravel/homestead/scripts/homestead.rb:177:in `block in configure'
    from /Applications/MAMP/htdocs/homestead/vendor/laravel/homestead/scripts/homestead.rb:166:in `each'
    from /Applications/MAMP/htdocs/homestead/vendor/laravel/homestead/scripts/homestead.rb:166:in `configure'
    from /Applications/MAMP/htdocs/homestead/Vagrantfile:30:in `block in <top (required)>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/v2/loader.rb:37:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/v2/loader.rb:37:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:107:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:107:in `block in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:104:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:104:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/vagrantfile.rb:28:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:746:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:746:in `vagrantfile'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:492:in `host'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:214:in `block in action_runner'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/action/runner.rb:33:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/action/runner.rb:33:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:479:in `hook'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:728:in `unload'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/bin/vagrant:130:in `ensure in <main>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/bin/vagrant:130:in `<main>'

尝试了我能做的任何事情,但仍然无法重新开箱。

另外,对于vagrant global-status,我可以在同一个文件夹中看到2个框:

id       name        provider   state    directory                           
-----------------------------------------------------------------------------
2727da4  default     virtualbox running  /Users/Leo/Homestead                
6ca3944  co-dev1     virtualbox running  /Users/Leo/vagrant-dev-co           
ae2f475  default     virtualbox running  /Users/Leo/nexuse-vagrant           
83fc055  default     virtualbox running  /Users/Leo/symfony-dev              
bb7c75f  homestead   virtualbox running  /Applications/MAMP/htdocs/homestead 
6634808  homestead-7 virtualbox poweroff /Applications/MAMP/htdocs/homestead 

试图摧毁6634808,但又出现了错误:

Bins:~ Leo$ vagrant destroy 6634808
/Applications/MAMP/htdocs/homestead/vendor/laravel/homestead/scripts/homestead.rb:4:in `configure': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Applications/MAMP/htdocs/homestead/Vagrantfile:30:in `block in <top (required)>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/v2/loader.rb:37:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/v2/loader.rb:37:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:107:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:107:in `block in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:104:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/config/loader.rb:104:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/vagrantfile.rb:28:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:746:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:746:in `vagrantfile'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:669:in `machine'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/plugin/v2/command.rb:147:in `block in with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/plugin/v2/command.rb:201:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/plugin/v2/command.rb:201:in `block in with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/plugin/v2/command.rb:183:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/plugin/v2/command.rb:183:in `with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/commands/destroy/command.rb:30:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/environment.rb:308:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.4/bin/vagrant:127:in `<main>'

homestead.yaml文件在这里:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: homestead
name: homestead
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: "/Applications/MAMP/htdocs/homestead/code"
      to: "/home/vagrant/Code"

sites:
    - map: 
      to: "/home/vagrant/Code/co-orion/public"
    - map: dev.lara.com
      to: "/home/vagrant/Code/lara/public"
    - map: dev.lara53.com
      to: "/home/vagrant/Code/laravel53/public"
    - map: dev.es.com
      to: "/home/vagrant/Code/es"
    - map: dev.laradminlte.com
      to: "/home/vagrant/Code/laradminlte/public"
    - map: dev.lavalite.com
      to: "/home/vagrant/Code/lavalite/public"
databases:
    - orion

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

ports:
#     - send: 50000
#       to: 5000
    - send: 62000
      to: 9200
      protocol: tcp

1 个答案:

答案 0 :(得分:0)

SSH密钥身份验证失败可能是问题

您应该编辑Homestead.yaml文件。在此文件中,您可以配置公共SSH密钥的路径,以及希望在主计算机和Homestead虚拟机之间共享的文件夹。

没有SSH密钥?在Mac和Linux上,通常可以使用以下命令创建SSH密钥对:

ssh-keygen -t rsa -C "you@homestead"

在Windows上,您可以安装Git并使用Gi​​t附带的Git Bash shell发出上述命令。或者,您可以使用PuTTY和PuTTYgen。

创建SSH密钥后,在Homestead.yaml文件的authorize属性中指定密钥的路径。

相关问题