【问题标题】:Vagrant NameError: undefined local variable or method `config' for main:ObjectVagrant NameError:未定义的局部变量或方法'config'用于main:Object
【发布时间】:2018-10-12 16:51:05
【问题描述】:

我的机器 (MacBookPro) 上运行着 VirtualBox 上的一个 Vagrantfile,它运行良好。然后我安装了另一个 Vagrantfile。

即使我将它们都销毁了,我仍然无法使用 vagrant up 加载它

我手动关闭了所有虚拟机,但仍然出现此错误...

$ vagrant up

There was an error loading a Vagrantfile. The file being loaded and the error message are shown below. This is usually caused by a syntax error.    

Path: /Users/actual_username/.vagrant.d/boxes/actual_vagrantfile_name/0.3-centos-actualSNAPSHOT_number/virtualbox/Vagrantfile
Line number: 0
Message: NameError: undefined local variable or method `config' for main:Object

【问题讨论】:

    标签: vagrant virtual-machine vagrantfile vagrant-plugin


    【解决方案1】:

    您可能需要添加 Vagrant.configure("2") do |config| 无论您在 vagrantfile 中使用 config 变量的什么地方。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-07
      • 1970-01-01
      • 2013-08-19
      相关资源
      最近更新 更多