2014-11-01 100 views
3

我是Laravel的新手,我將爲我的應用程序設置VM。我正在關注文檔,我幾乎完成了配置。我被困在這裏。在Laravel 5中配置Homestead.yaml的問題

我有Windows 8和我Homestead.yaml文件看起來像這樣:

authorize: E:/laravel_projects/Homestead/keys.pub 

keys: 
    - ~/.ssh/id_rsa 

folders: 
    - map: E:/laravel_projects 
     to: E:/vagrant/laravel_projects 

sites: 
    - map: learn.app 
     to: E:/vagrant/laravel_projects/myfirstapp/public 

variables: 
    - key: APP_ENV 
     value: local 

錯誤是這樣的,當我在cmd中運行流浪了。

E:/laravel_projects/Homestead/scripts/homestead.rb:26:in `read': No such file or directory - E:/laravel_projects/Homestead/keys.pub (Errno::ENOENT) 
    from E:/laravel_projects/Homestead/scripts/homestead.rb:26:in `block in configure' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/kernel_v2/config/vm_provisioner.rb:72:in `call' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/kernel_v2/config/vm_provisioner.rb:72:in `add_config' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/kernel_v2/config/vm.rb:285:in `provision' 
    from E:/laravel_projects/Homestead/scripts/homestead.rb:24:in `configure' 
    from E:/laravel_projects/Homestead/Vagrantfile:9:in `block in <top (required)>' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/v2/loader.rb:37:in `call' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/v2/loader.rb:37:in `load' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:103:in `block (2 levels) in load' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:97:in `each' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:97:in `block in load' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:94:in `each' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:94:in `load' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/vagrantfile.rb:28:in `initialize' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:614:in `new' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:614:in `vagrantfile' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:399:in `host' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:198:in `block in action_runner' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:33:in `call' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:33:in `run' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:386:in `hook' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:596:in `unload' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/bin/vagrant:177:in `ensure in <main>' 
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/bin/vagrant:177:in `<main>' 

我的項目路徑是E:/ laravel_projects。

+0

控制檯錯誤最好作爲文本提供,而不是截圖 - 人們閱讀起來更容易。你會交換嗎? – halfer 2014-11-01 07:48:39

+1

好吧..完成! – 2014-11-01 09:16:10

回答

1

應該是這樣的:

folders: 
    - map: E:/laravel_projects 
     to: /home/vagrant/laravel_projects 
    - map: E:/laravel_projects/myfirstapp 
     to: /home/vagrant/laravel_projects/myfirstapp 

sites: 
    - map: learn.app 
     to: /home/vagrant/laravel_projects/myfirstapp/public 

你的Linux VM將不會有一個E盤。

+0

謝謝肉汁..但沒有太大的幫助。仍然收到一些錯誤。不知道我錯過了什麼。關鍵部分有什麼改變? – 2014-11-03 04:55:29

+0

你有沒有試過'流浪加載 - 配置'? – Gravy 2014-11-03 08:58:07

+1

另外,請參閱更新的答案。你需要在你的文件夾中包含'myfirstapp'。最後,按照錯誤消息,您的'keys.pub'文件不在'E:/ laravel_projects/Homestead/keys.pub'中。 – Gravy 2014-11-03 09:13:28

1

看看你的錯誤的第一行:

E:/laravel_projects/Homestead/scripts/homestead.rb:26:in `read': No such file or directory - E:/laravel_projects/Homestead/keys.pub (Errno::ENOENT)

顯然,關鍵是不存在的。確保你已經生成了一個SSH密鑰並指定了正確的路徑。

此外,在您的Homestead.yaml:

keys: 
    - ~/.ssh/id_rsa 

這是通向你的私鑰,雖然它是一個* nix的路徑。您需要將其設置爲您的Windows系統上生成的私鑰的路徑。