Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Laravel 4 Basics Getting Started with Laravel Installing Laravel Homestead

Darren Burges
Darren Burges
4,453 Points

error attempting to start the vagrant server

following along with the video, when running 'vagrant up' I get the following error. I believe my paths are wrong in homestead.yaml

/Users/darrenburgess/Homestead/Vagrantfile:17:in `read': No such file or directory - /Users/darrenburgess/.homestead/Homestead.yaml (Errno::ENOENT)

Darren Burges
Darren Burges
4,453 Points
ip: "10.0.10.10"
memory: 2048
cpus: 1

authorize: ~/Users/darrenburgess/.ssh/id_rsa.pub

keys:
    - ~/Users/darrenburgess.ssh/id_rsa

folders:
    - map: ~/Users/darrenburgess/Homestead/Code
      to: /home/vagrant/Sites

sites:
    - map: laravel.dev
      to: /home/vagrant/Sites/laravel-basics/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

7 Answers

Darren Burges
Darren Burges
4,453 Points

I figured it out. My paths were incorrect. The tilde in front results in home being in the path twice as in Users/darrenburgess/Users/darrenburgess/.... etc

Also note that the video is slightly outdated. per laravel docs, you need to run 'bash init.sh' to create the Homestead.yaml file in the home/.homestead directory. Then you edit the file in .homestead.

Nick Roberts
Nick Roberts
5,465 Points

Hey Stefan, I was getting the exact same issue--with the exact same error message log.

The problem lay in the Vagrantfile: the homesteadYamlPath variable was screwed up for me. I changed the paths and got the Vagrant server to boot:

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION = "2"

homesteadYamlPath = File.expand_path("~/Homestead/src/stubs/Homestead.yaml")
afterScriptPath = File.expand_path("~/.homestead/after.sh")
aliasesPath = File.expand_path("~/.homestead/aliases")

require_relative 'scripts/homestead.rb'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    if File.exists? aliasesPath then
        config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
    end

    Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))

    if File.exists? afterScriptPath then
        config.vm.provision "shell", path: afterScriptPath
    end
end
Matthew Bingham
Matthew Bingham
11,927 Points

I had a similar issue but managed to resolved it. Here's what I did - hopefully it's useful for anyone looking at this in the future!

It appears that the Homestead.yaml file is now relocated in the src/stubs folder. Edit the content as per the video in this file.

Issues with Windows

If you receive errors such as:

C:/lavarel/Homestead/Vagrantfile:17:in `read': No such file or directory - C:/cygwin64/home/Bieler/.homestead/Homestead.yaml (Errno::ENOENT)
        from C:/lavarel/Homestead/Vagrantfile:17:in `block in <top (required)>'

In sublime (or you text editor), the following files should look like this (change <USER> to your correct path).

Vagrantfile

Browse to the root of Homestead and open Vagrantfile. Change to the following code:

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION = "2"

homesteadYamlPath = File.expand_path("~/Homestead/src/stubs/Homestead.yaml")
afterScriptPath = File.expand_path("~/.homestead/after.sh")
aliasesPath = File.expand_path("~/.homestead/aliases")

require_relative 'scripts/homestead.rb'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    if File.exists? aliasesPath then
        config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
    end

    Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))

    if File.exists? afterScriptPath then
        config.vm.provision "shell", path: afterScriptPath
    end
end

Homestead.yaml

Note that this is now in the src/stubs folder (as opposed to the root as shown in the video).

---
ip: "10.0.10.0"
memory: 2048
cpus: 1
provider: virtualbox

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-basics/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 93000
#       to: 9300
#     - send: 7777
#       to: 777
#       protocol: udp

Hope that helps someone!

I've got the same issue, but I dont underrstand what zou did to fix it.

---
ip: "192.168.10.10"
memory: 2048
cpus: 1

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

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

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

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
C:/lavarel/Homestead/Vagrantfile:17:in `read': No such file or directory - C:/cygwin64/home/Bieler/.homestead/Homestead.yaml (Errno::ENOENT)
        from C:/lavarel/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>'
Matthew Bingham
Matthew Bingham
11,927 Points

Going through other Laravel tutorials this week (including the great free videos on laracast), I opted to use my previous local dev environment - Windows/XAMP/SQL. I find this a lot easier to use (vs. homestead and VM) and am utilising Heidi Sql to check database tables and columns - I find it much easier and faster with this GUI view.

Paul Mosley
Paul Mosley
437 Points

Hi

I was hoping someone could help me here I've been looking at this for hours now.

I keep getting the following error message when I type the 'vagrant up' command

/Users/paulmosley/Homestead/Vagrantfile:18:in read': No such file or directory - /Users/paulmosley/.homestead/Homestead.yaml (Errno::ENOENT) from /Users/paulmosley/Homestead/Vagrantfile:18:inblock in <top (required)>' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/loader.rb:37:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/loader.rb:37:inload' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:103:in block (2 levels) in load' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:97:ineach' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:97:in block in load' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:94:ineach' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb:94:in load' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:28:ininitialize' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:691:in new' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:691:invagrantfile' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:441:in host' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:207:inblock in action_runner' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:33:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:33:inrun' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:428:in hook' from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:673:inunload' from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/bin/vagrant:177:in ensure in <main>' from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/bin/vagrant:177:in<main>' paulmosleysmbp:Homestead paulmosley$

My .yaml file is:


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

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

keys: - /Users/paulmosley/.ssh/id_rsa.pub

folders: - map: /Users/paulmosley/Homestead/Projects to: /home/vagrant/Sites

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

databases: - homestead

variables: - key: APP_ENV value: local

blackfire:

- id: foo

token: bar

client-id: foo

client-token: bar

ports:

- send: 93000

to: 9300

- send: 7777

to: 777

protocol: udp

Does anyone know how I can fix this it's driving me mad.

Thank you in advance.

Matthew Bingham
Matthew Bingham
11,927 Points

Hi Paul, The yaml location looks incorrect? Did you read my earlier post? In L5, yaml is now located here >

homesteadYamlPath = File.expand_path("~/Homestead/src/stubs/Homestead.yaml").  

Tryreading my post above and see whether changing the config helps.

Laurie Williams
Laurie Williams
10,174 Points

Just a quick comment, I had to move my .yml file into src/sub to get vagrant up to run.