简体   繁体   English

流浪汉和宅基地

[英]Vagrant and Homestead

What I'm wanting to accomplish is installing Vagrant and Laravel's Homestead on my local computer so that I can do away with MAMP which I actually deleted yesterday. 我要完成的工作是在本地计算机上安装Vagrant和Laravel的Homestead,以便取消昨天实际上删除的MAMP。

I had installed both Vagrant and Homestead however I later found out that my computer wouldn't let me run the php artisan migrate command because it was saying no file found. 我已经安装了Vagrant和Homestead,但是后来我发现我的计算机不允许我运行php artisan migrate命令,因为它说没有找到文件。

I did some digging and had someone tell me to do some changes in the my.cnf file. 我做了一些挖掘,然后有人告诉我对my.cnf文件进行一些更改。

So I logged into my VM and tried to locate the file however it informed me there was no file with that name or extension inside the MySQL folder. 因此,我登录到我的VM并尝试查找该文件,但是它通知我MySQL文件夹内没有具有该名称或扩展名的文件。

Can someone help me get settled back up so I can continue normally on my project? 有人可以帮助我重新安顿下来,以便我继续正常进行我的项目吗?

Me-iMac:~ me$ vagrant box remove laravel/homestead
Box 'laravel/homestead' (v0.2.5) with provider 'virtualbox' appears
to still be in use by at least one Vagrant environment. Removing
the box could corrupt the environment. We recommend destroying
these environments first:

default (ID: e5a3663ef2cf4e91a02e8c7e99fa584b)

Are you sure you want to remove this box? [y/N] y
Removing box 'laravel/homestead' (v0.2.5) with provider 'virtualbox'...
me-iMac:~ me$ vagrant box add laravel/homestead
==> box: Loading metadata for box 'laravel/homestead'
    box: URL: https://atlas.hashicorp.com/laravel/homestead
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) virtualbox
2) vmware_desktop

Enter your choice: 1
==> box: Adding box 'laravel/homestead' (v0.2.5) for provider: virtualbox
    box: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.5/providers/virtualbox.box
==> box: Successfully added box 'laravel/homestead' (v0.2.5) for 'virtualbox'!
me-iMac:~ me$ homestead ssh
Welcome to Ubuntu 14.10 (GNU/Linux 3.16.0-23-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
Last login: Mon Apr 20 14:06:45 2015 from 10.0.2.2
vagrant@homestead:~$ locate my.cnf
vagrant@homestead:~$ which mysql
/usr/bin/mysql
vagrant@homestead:~$

Based on your Terminal dump, I can't tell whether you've created your Homestead.yaml file. 根据您的终端转储,我无法确定您是否已创建Homestead.yaml文件。 Make sure you do that so that you can access your development files from within Homestead. 确保执行此操作,以便可以从Homestead中访问开发文件。 Run homestead init , then homestead edit , and configure your shared folders and Nginx sites. 运行homestead init ,然后运行homestead init homestead edit ,并配置共享文件夹和Nginx站点。 Once done, you'll need to homestead destroy and homestead up again to allow the changes to take effect. 完成后,您将需要进行homestead destroy并重新homestead up以使更改生效。

After all that, SSH back into Homestead, change to the shared folder you set up, and try to run php artisan migrate , making sure that there is in fact an artisan file in the Laravel installation directory. 完成所有这些之后,SSH返回Homestead,更改为您设置的共享文件夹,然后尝试运行php artisan migrate migration,确保Laravel安装目录中实际上存在artisan文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM