I am getting this error when trying to run the "vagrant up" terminal command:
There are errors in the configuration of this machine. Please fix the following errors and try again:
*A box must be specified.
In my Homestead/.vagrant/machines/default/virtualbox
folder, there is no file there, so I'm assuming that is what it's referring to when it says a box must be specified, however I don't know how to include a box as this is my first time using vagrant, and I've searched online with no resolve.
Anyone have a solution to this?
EDIT (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
Best Answer
Inside the homestead directory, you have to run the command
bash init.sh
.This will generate the
Homestead.yaml
file (andafter.sh
andaliases
) inside your home directory (~
).If you are changing
Homestead.yaml
again, you have to re-runbash init.sh
again. It will ask for overwrite, say yes.(also, be sure that the directory for
folders: - map:
exists)