0

While I am trying to run the following script as a shell script, I get an error saying

./install_local.sh: line 8: syntax error near unexpected token `"2"'
./install_local.sh: line 8: `Vagrant.configure("2") do |config|'

What could be the reason for this? Vagrant source

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

    # All Vagrant configuration is done below. The "2" in Vagrant.configure
    # configures the configuration version (we support older styles for
    # backwards compatibility). Please don't change it unless you know what
    # you're doing.
    Vagrant.configure(2) do |config|
      config.vm.box = "ubuntu/trusty64"
      config.vm.network "private_network", ip: "192.168.33.10"
      config.vm.provider "virtualbox" do |vb|
        vb.memory = "2048"
      end
      config.vm.provision "shell", inline: <<-SHELL
      SHELL
    end
helloJSON
  • 1,389
  • 3
  • 10
  • 10

1 Answers1

0

You have some confusion

Your script is a Vagrantfile not a shell script. Rename your install_local.sh as Vagrantfile and run vagrant up

Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
  • I renamed `install_local.sh` to `Vagrantfile` and run `vagrant up`. It says `Path: /home/ubuntu/Vagrantfile Line number: 138 Message: ArgumentError: wrong number of arguments (given 0, expected 1)` – helloJSON Feb 02 '17 at 14:45
  • The total number of lines however in the file are `125` – helloJSON Feb 02 '17 at 14:46
  • so this is not from the Vagrantfile - show the full error, its related to another script – Frederic Henri Feb 02 '17 at 15:16