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 4 Basics Getting Started with Laravel Installing Laravel Homestead

Thorstein Nordby
Thorstein Nordby
17,115 Points

Problems with Ruby when installing Laravel

Hi

I am following Hampton's videos on Laravel, and after getting my SSH-key and adding it to GitHub, configuring Homestead.yaml and issuing the "vagrant up" command in the console, I get this error:

/Applications/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping values are not allowed in this context at line 2 column 3 (Psych::SyntaxError)
    from /Applications/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
    from /Applications/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:153:in `parse'
    from /Applications/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:129:in `load'
    from /Users/tnordby/Homestead/Vagrantfile:9:in `block in <top (required)>'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/v2/loader.rb:37:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/v2/loader.rb:37:in `load'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:103:in `block (2 levels) in load'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:97:in `each'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:97:in `block in load'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:94:in `each'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:94:in `load'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/vagrantfile.rb:28:in `initialize'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:614:in `new'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:614:in `vagrantfile'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:399:in `host'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:198:in `block in action_runner'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:33:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:33:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:386:in `hook'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:596:in `unload'
    from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/bin/vagrant:177:in `ensure in <main>'
    from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/bin/vagrant:177:in `<main>'

I have tried googling this, didn't quite understand the solutions I found.

Anyone knows how to fix this?

Thanks!

5 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Thorstein;

I seem to recall getting similar error messages to that if I have tab characters in my Homestead.yaml file. It does not like TAB characters, only spaces.

Check that, save the Homestead.yaml and try "vagrant up" again.

Post back if it works or not.

Thanks,

Ken

Thorstein Nordby
Thorstein Nordby
17,115 Points

That worked!

Thanks, Ken!

Now I get:

vm:
* The shared folder guest path must be absolute: 

shell provisioner:
* Shell provisioner `args` must be a string or array.
* Shell provisioner `args` must be a string or array.

This is my homestead.yaml file:

---
ip: "xxx.xxx.xx.xx"
memory: 2048
cpus: 1

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

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

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

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

variables:
- key: APP_ENV
value: local

Any ideas? Thanks!

Ken Alger
Ken Alger
Treehouse Teacher

Thorstein;

Another thought, what version of Vagrant are you running?

Ken

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Thorstein;

I forgot to mention that after you change the Homestead.yaml file you need to run the following command in the command line:

vagrant provision

or, if that is unsuccessful, try

vagrant reload --provision

That will, without getting too technical, reload the Homestead.yaml settings that have now been changed by taking out the tabs. Similarly, if you add a new project to the Homestead.yaml file, you will need to run vagrant provision again.

Post back if you get it to work, or need more assistance.

Ken

Thorstein Nordby
Thorstein Nordby
17,115 Points

With

vagrant provision

I get

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

vm:
* The shared folder guest path must be absolute: 

shell provisioner:
* Shell provisioner `args` must be a string or array.
* Shell provisioner `args` must be a string or array.

vagrant reload --provision does not work either.

Can't figure out the absolute path thing.

James Bullis
James Bullis
12,762 Points

Put two spaces on the lines with to: so that they match up with map:

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

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