Monday, February 27, 2017

Mac: Laravel homestead - vagrant up Error

I am using Vagrant and Virtual box for virtual host in laravel homestead. When I give vagrant up I got the following error.

Bringing machine '***********' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

shell provisioner:
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name

This is my vagrant file:

# -*- mode: ruby -*-
# vi: set ft=ruby :

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))

homesteadYamlPath = "Homestead.yaml"
homesteadJsonPath = "Homestead.json"
afterScriptPath = "after.sh"
aliasesPath = "aliases"

require File.expand_path(confDir + '/scripts/homestead.rb')

#Vagrant.require_version '>= 1.8.4'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    if File.exist? aliasesPath then
        config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases"
        config.vm.provision "shell" do |s|
          s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases"
        end
    end

    if File.exist? homesteadYamlPath then
        settings = YAML::load(File.read(homesteadYamlPath))
    elsif File.exist? homesteadJsonPath then
        settings = JSON.parse(File.read(homesteadJsonPath))
    end

    Homestead.configure(config, settings)

    if File.exist? afterScriptPath then
        config.vm.provision "shell", path: afterScriptPath, privileged: false
    end

    if defined? VagrantPlugins::HostsUpdater
        config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] }
    end
end

Its show required higher version of vagrant so I just commanded that line.

This is my Homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: *******"
name: *******"
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: "/Users/*******"
      to: "/home/vagrant//*******""

sites:
    - map: *******.app
      to: "/home/vagrant/*******/public"

databases:
    - *******

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

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

I know by upgrading my virtual box and vagrant version it will solve the issue. But I have lost of existing laravel project in current virtual box. If I upgrade my box it shows error for my older applications.

Can anyone help me how to overcome this?




via Muthu17

Advertisement