【发布时间】:2015-01-25 21:24:10
【问题描述】:
我已经成功使用宅基地大约一个小时了,但是当我使用vagrant suspend 暂停我的虚拟机并尝试使用vagrant up 再次启动它时,我收到了这个错误:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
shell provisioner:
* Shell provisioner `args` must be a string or array.
这是什么意思?流浪者文档说
shell 配置器有多种选择。内联或路径之一是 必填
我需要在某处传递一些参数吗?我做错了什么?
提前致谢
这是我的流浪文件:
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION = "2"
homesteadYamlPath = File.expand_path("~/.homestead/Homestead.yaml")
afterScriptPath = File.expand_path("~/.homestead/after.sh")
aliasesPath = File.expand_path("~/.homestead/aliases")
require_relative 'scripts/homestead.rb'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if File.exists? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
end
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
if File.exists? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath
end
end
【问题讨论】:
-
将内容粘贴到
Vagrantfile -
对不起,您指的是什么内容?我是这个话题的大菜鸟:p
-
当你启动一个vagrant实例时,你需要一个默认或自定义的
Vagrantfie文件,把内容粘贴到这里。如果没有,您需要运行vagrant init来生成它。 -
我已将我的 vagrantfile 添加到我的问题中。我已经运行了 vagrant init,当我运行 vagrant box list 时我有两个宅基地框