php - 在 Laravel 5 中配置 Homestead.yaml 的问题

标签 php laravel-5

我是 Laravel 的新手,我要为我的应用程序设置虚拟机。我很好地遵循了文档并且我几乎完成了配置。我被困在这里。

我有 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中运行Vagrant up时报错是这样的。

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。

最佳答案

应该是这样的:

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 盘。

关于php - 在 Laravel 5 中配置 Homestead.yaml 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26686880/

相关文章:

php - 如何在条形图mysql中回显carno的名称

php - 如何在 X 时间后仅发送一次电子邮件

php - 多对多关系在 laravel 中存储和更新

mysql - Laravel 在 whereHas 中使用 select

php - 如何从 MySQL/PHP 中获取每个科目的科目名称和错过的作业总数

php - 从另一个 php 文件执行 php 文件使用太多 CPU

php - 如何使用 laravel 将一个表的内容传输到另一个数据库表

php - Laravel 5 使用具有许多关系的数据透视表

javascript - mix.scripts 不工作(webpack.mix.js)

php - Laravel 5.1 - 获取当前路线