0

当我尝试将以下脚本作为 shell 脚本运行时,我收到一条错误消息

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

这可能是什么原因?流浪来源

        # -*- 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
4

1 回答 1

0

你有一些困惑

您的脚本是 Vagrantfile 而不是 shell 脚本。重命名install_local.shVagrantfile并运行vagrant up

于 2017-02-02T14:36:18.987 回答