1

每次我从控制台运行宅基地时都会出现错误,有人可以给我一个解决方案吗?

    homestead.bat up
    C:/Users/Evan Oscar/AppData/Roaming/Composer/vendor/laravel/homestead/Vagrantfile:17:in `read': No such file or directory - C:/cygwin64/home/Evan Oscar/.homestead/Homestead.yaml (Errno::ENOENT)
    from C:/Users/Evan Oscar/AppData/Roaming/Composer/vendor/laravel/homestead/Vagrantfile:17:in `block in <top (required)>'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/loader.rb:37:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/loader.rb:37:in `load'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:103:in `block (2 levels) in load'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:97:in `each'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:97:in `block in load'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:94:in `each'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:94:in `load'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:28:in `initialize'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:691:in `new'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:691:in `vagrantfile'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:441:in `host'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:207:in `block in action_runner'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:33:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:33:in `run'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:428:in `hook'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:673:in `unload'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/bin/vagrant:177:in `ensure in <main>'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/bin/vagrant:177:in `<main>'

这是我的 homestead.yaml 文件:

    ip: "192.168.10.10"
    memory: 2048
    cpus: 1
    provider: virtualbox

    authorize: ~/.ssh/id_rsa.pub

    keys:
    - ~/.ssh/id_rsa

    folders:
    - map: ~/Code
    to: /home/vagrant/Code

    sites:
    - map: homestead.app
    to: /home/vagrant/Code/Laravel/public

    databases:
    - homestead

    variables:
    - key: APP_ENV
    value: local

我怀疑我的文件夹名称可能有问题?因为我使用“Evan Oscar”,或者安装宅基地时我想念什么?有人可以帮我吗?我已经在网上搜索解决方案,但没有一个真正有效

4

1 回答 1

1

我将从头开始解释这些步骤,以便您检查是否做错了什么。我建议您删除您的 homestead 文件夹并尝试再次安装它以查看会发生什么。

您是在本地还是全球安装宅基地?

(喜欢git clone https://github.com/laravel/homestead.git Homesteadcomposer global require laravel/homestead

如果答案是在本地,则需要进入克隆 homestead 时创建的文件夹,然后运行此命令来初始化 homestead 的配置文件(~/.homestead/Homestead.yaml 或 c:\users\username.homestead\Homestead. yaml for windows)

bash init.sh

如果你在全局安装它,你可以在任何地方使用这个命令。之后,您只需要按照文档中的说明配置 Homestead.yaml文件

不要忘记创建您的

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

我注意到您正在使用 homestead.yaml 配置的默认样式,尝试更改 url 以获得更类似于 windows 的格式

authorize: c:\Users\username\.ssh\homestead_rsa.pub

keys:
    - c:\Users\username\.ssh\homestead_rsa

folders:
    - map: C:\

只有这样你才能运行

homestead up
于 2015-12-04T10:56:59.353 回答