当尝试运行“vagrant up”终端命令时,我遇到了以下错误:
"There are errors in the configuration of this machine. Please fix the following errors and try again:
*A box must be specified."
在我的Homestead/.vagrant/machines/default/virtualbox文件夹中没有找到任何文件。所以我猜它提到的是必须指定一个box,但是这是我第一次使用Vagrant,我在网上搜索没有得到解决方法。
有人有解决办法吗?
编辑(Vagrantfile):
"There are errors in the configuration of this machine. Please fix the following errors and try again:
*A box must be specified."
在我的Homestead/.vagrant/machines/default/virtualbox文件夹中没有找到任何文件。所以我猜它提到的是必须指定一个box,但是这是我第一次使用Vagrant,我在网上搜索没有得到解决方法。
有人有解决办法吗?
编辑(Vagrantfile):
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION = "2"
confDir = $confDir ||= File.expand_path("~/.homestead")
homesteadYamlPath = confDir + "/Homestead.yaml"
homesteadJsonPath = confDir + "/Homestead.json"
afterScriptPath = confDir + "/after.sh"
aliasesPath = confDir + "/aliases"
require File.expand_path(File.dirname(__FILE__) + '/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
if File.exists? homesteadYamlPath then
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
elsif File.exists? homesteadJsonPath then
Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
end
if File.exists? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath
end
end