Problems setting up Homestead.yaml in Laravel 5

I am new to Laravel and I am about to set up a virtual machine for my applications. I'm good at docs and I'm almost ready to set it up. I am stuck here.

I have Windows 8 and my Homestead.yaml file looks like this:

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

      

The error is something like this when I run Vagrant in 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>'

      

My project path is E: / laravel_projects.

+3


source to share


2 answers


There should be something like this:

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

      



Your Linux VM will not have drive E.

+1


source


Look at the first line in your error:

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

Apparently there is no key. Make sure you create an SSH key and provide the correct path to it.



Also, in your Homestead.yaml:

keys:
    - ~/.ssh/id_rsa

      

This is the path to your private key, although this is the * nix path. You need to set this to the path to the generated private key on your Windows system.

+1


source







All Articles