Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Laravel Vagrant up error

So when I type in the command Vagrant up, I get this error message:

There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The host path of the shared folder is missing: ~/Code

There is some sort of path issue.

In the video, Hampton Paulk's Homestead.yaml file looked different. For him it look like this

authorize: /Users/me/.ssh/id_rsa.pub

keys:
    - /Users/me/.ssh/id_rsa

But for me, it looked like this

authorize: ~code/.ssh/id_rsa.pub

keys:
    - ~code/.ssh/id_rsa

I changed to match his, but I feel like thats what caused the error

any advice would be much appreciated

Thanks!

8 Answers

Issue solved for MAC

1 - Go to Homestead Folder (Finder)

2 - Create Projects Folder (Finder)

3 - Edit Homestead.yaml in Homestead/src/stubs/ (Finder) (Sublime Text 3) (like treehouse video)

4 - Go to Homestead Folder (Terminal)

5 - Run the command “bash init.sh” and type “y” to replace 3 files as indicated (Terminal)

6 - Run “vagrant up” (Terminal)

And it’s solved this issue.

You need to create a user for your computer. What type of computer are you on?

I did create it on my computer. Im on my mac. ~code/ just means my username. I got it working! But thank you!

Trent, how did you fix it?

I think it has to do with my yaml file? It's located Homestead > src > stubs > Homestead.yaml

I've created the "Projects folder", but still having "* The host path of the shared folder is missing: ~/Code". Help?

Folder Structure:

  • /Projects
  • /Homestead

Yaml File:

authorize: ~/.ssh/id_rsa.pub

keys: - ~/.ssh/id_rsa

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

sites: - map: laravel.dev to: /home/vagrant/Code/Laravel/public

Help would be greatly appreciated! thanks

Please someone help with an answer. I have the same "missing: ~/Code " error although I don't have a Code directory in homestead.yaml file any more. I am using a windows computer.

After going through the whole range of emotions, from anger to resignation, I managed to solve the problem :) .

First I created the Code directory manually in the home folder (mine was C:/Users/Dragos), and ran vagrant up again, but got all sorts of other errors.

Then I just removed the vagrant box with vagrant box remove 'laravel/homestead' and added it again. This solved the problem for me and vagrant up worked without errors. Only problem is it created a Code directory in my virtual enviroment instead of the one specified in the Homestead.yaml file, which was called projects.

Hope I was of some help to you.

I am also having the same issue with the homestead.yaml file being created in the Homestead > src > stubs directory. I'm guessing this has something to do with the missing: ~/Code error.

I'm somewhere between anger and resignation myself.

Did anyone get this to work? I'm also having this issue and looking for hours to fix it. Please help!

Not me. Too bad, because the hard part about learning a language shouldn't be the setup.

I've found out what the problem was, I was changing the wrong .yaml file.

Perhaps this will also work in your case:

  1. Copy the contents of the Homestead.yaml (from the directory: Homestead > src > stubs)
  2. Open Terminal en run this two commands (this will show hidden files on your computer):
# defaults write com.apple.finder AppleShowAllFiles YES
# killall Finder
  1. Go to your home directory from the Finder. You will now see a ".homestead" folder, open the folder by double click (or secondary menu > "open in new tab")
  2. Now you'll see a Homestead.yaml file, open it and paste the contents from the first step here. Now you should able to run the "vagrant up" command in Terminal.

Hope this also works in your case!