【发布时间】:2018-08-03 18:02:53
【问题描述】:
我对 Vagrant 很陌生(昨天刚安装)。我正在尝试按照this answer 设置我的代理设置。我已经安装了proxyconf 插件。
我正在运行 Windows 7 64 位。我假设有问题的Vagrantfile 是C:\Users\<my username>\.vagrant.d\Vagrantfile。该文件不存在,因此我将其内容设置为上面链接的答案中给出的三行(当然yourproxy 替换为我的实际代理):
config.proxy.http = "http://yourproxy:8080" config.proxy.https = "http://yourproxy:8080" config.proxy.no_proxy = "localhost,127.0.0.1"
现在我正在尝试运行 Vagrant 命令(我从另一个在线教程中获得)
vagrant box add bento/centos-7 --provider=virtualbox
当我运行它时,我得到以下信息:
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: C:/Users/<my username>/.vagrant.d/Vagrantfile
Line number: 0
Message: NameError: undefined local variable or method `config' for main:Object
很抱歉,这可能是由于我对 Vagrant 的了解极其有限,但是有人可以帮助我如何正确设置它吗?
【问题讨论】:
标签: vagrant