2017-04-26 66 views
0

我的流浪者箱子遇到了一個奇怪的問題。我對流浪漢不是很熟悉。只是想檢查一下是否有人解決了同樣的問題,或者至少可以給我一些啓示。在此先感謝您的幫助!添加新網站後家園流浪者破損

箱子工作正常,直到我添加了一個新的laravel站點(我沒有改變vagrantfile中的任何內容,只添加了站點地圖爲新站點)作曲家安裝後,我試圖重新加載流浪漢框。然後我得到的錯誤如下:

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>' 

試過任何我可以但仍然無法再次得到框。

同樣在顛沛流離的全球地位,我可以看到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 
+0

你有一個'Homestead.yaml'文件嗎? –

+0

嗨弗雷德裏克亨利!謝謝你的時間。剛剛添加了Homestead.yaml文件。 – northblue

+0

@FrédéricHenri我發現了這個問題。不知何故,網站映射部分有一個錯字。讚賞您的幫助!祝你愉快! – northblue

回答

0

SSH密鑰認證失敗可能是問題

您應該編輯Homestead.yaml文件。在此文件中,您可以配置公用SSH密鑰的路徑,以及希望在主機和Homestead虛擬機之間共享的文件夾。

沒有SSH密鑰?在Mac和Linux,你可以使用下面的命令通常創建SSH密鑰對:

ssh-keygen -t rsa -C "[email protected]" 

在Windows上,你可以安裝Git和使用Git的Bash shell中包括在GIT發出上述命令。或者,您可以使用PuTTY和PuTTYgen。

創建SSH密鑰後,在Homestead.yaml文件的authorize屬性中指定密鑰的路徑。