Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

homestead.rb:63:in `configure': undefined method `each' for nil:NilClass (NoMethodError)

I followed how to install Laravel but after all when I entered "vagrant up" i get these errors:

C:/Users/Renz/code/Homestead/scripts/homestead.rb:63:in configure': undefined m ethodeach' for nil:NilClass (NoMethodError) from C:/Users/Renz/code/Homestead/Vagrantfile:9:in block in <top (requi red)>' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/v2/loader.rb:37:incall' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/v2/loader.rb:37:in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/loader.rb:103:inblock (2 levels) in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/loader.rb:97:in each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/loader.rb:97:inblock in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/loader.rb:94:in each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/c onfig/loader.rb:94:inload' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/v agrantfile.rb:28:in initialize' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/e nvironment.rb:614:innew' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/e nvironment.rb:614:in vagrantfile' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/e nvironment.rb:399:inhost' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/e nvironment.rb:198:in block in action_runner' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/a ction/runner.rb:33:incall' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/a ction/runner.rb:33:in run' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/e nvironment.rb:386:inhook' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/e nvironment.rb:596:in unload' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/bin/vagrant:1 77:inensure in ' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/bin/vagrant:1 77:in `'

i tried re-installing multiple times but still get the same error.

Please help, I really need to fix this now. Appreciate it, thanks.

like image 691
Renz Avatar asked Nov 15 '14 08:11

Renz


2 Answers

You need to have a database added to your Homestead.yaml:

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

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

sites:
    - map: test.app
      to: /home/vagrant/test/public

databases:
    - name: testprogram

variables:
    - key: APP_ENV
      value: local
like image 152
Jon McEroy Avatar answered Oct 14 '22 22:10

Jon McEroy


It happens when your Homestead.yamel file is like this

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

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

sites:
    - map: test.app
      to: /home/vagrant/test/public
ports: < This line should be comment too<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
#   - send: 80
#     to: 80

if you comment that line or delete it the it should work fine

like image 36
Seyed Hussein Mirzaki Avatar answered Oct 14 '22 21:10

Seyed Hussein Mirzaki