Laravel 流浪者:流浪者向上命令给出;“必须指定一个方框”;错误
我在尝试运行“vagrant up”终端命令时遇到此错误: 这台机器的配置有错误。请修复以下错误并重试: *必须指定一个框 在我的Laravel 流浪者:流浪者向上命令给出;“必须指定一个方框”;错误,laravel,terminal,vagrant,virtualbox,homestead,Laravel,Terminal,Vagrant,Virtualbox,Homestead,我在尝试运行“vagrant up”终端命令时遇到此错误: 这台机器的配置有错误。请修复以下错误并重试: *必须指定一个框 在我的Homestead/.vagrant/machines/default/virtualbox文件夹中,没有文件,所以我假设当它说必须指定一个框时,它指的就是这个,但是我不知道如何包含一个框,因为这是我第一次使用vagrant,而且我在网上搜索时没有任何解析 有人能解决这个问题吗 编辑(文件): 如果您使用的是宅地套餐,请使用宅地套餐,而不是流浪者套餐。它已经知道所有文
Homestead/.vagrant/machines/default/virtualbox
文件夹中,没有文件,所以我假设当它说必须指定一个框时,它指的就是这个,但是我不知道如何包含一个框,因为这是我第一次使用vagrant,而且我在网上搜索时没有任何解析
有人能解决这个问题吗
编辑(文件):
如果您使用的是宅地套餐,请使用
宅地套餐
,而不是流浪者套餐
。它已经知道所有文件的位置,并且可以轻松地启动VM。通过在homestead.yaml中修复我的文件路径,解决了这个问题。当我在终端中进行安装时,一个.homestead文件夹正在主homestead文件夹之外创建,这就是导致我出现问题的原因。但是在将.homestead/homestead.yaml中的路径更改为my homestead/homestead.yaml中的路径后,问题不再存在。在homestead目录中,必须运行命令bash init.sh
这将在您的主目录(~
)中生成Homestead.yaml
文件(以及after.sh
和别名)
如果再次更改homestad.yaml
,则必须再次运行bash init.sh
。它将要求覆盖,请说“是”
(另外,请确保文件夹的目录:-map:
存在)homestead up给出一个错误,表示没有这样的文件或目录,但是bash init.sh命令是否覆盖homestead.yaml?这就是我的机器上发生的事情。如果我编辑homestead.yaml文件并使用bash init.sh,我的更改将恢复。我是新来的家园,试图建立它,到目前为止没有运气。
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