MAC:Laravel Homestead-流流式错误



我在Laravel Homestead中使用Vagrant和Virtual Box。当我给流动时,我会收到以下错误。

Bringing machine '***********' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
shell provisioner:
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name
* The following settings shouldn't exist: name

这是我的流浪文件:

# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))
homesteadYamlPath = "Homestead.yaml"
homesteadJsonPath = "Homestead.json"
afterScriptPath = "after.sh"
aliasesPath = "aliases"
require File.expand_path(confDir + '/scripts/homestead.rb')
#Vagrant.require_version '>= 1.8.4'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    if File.exist? aliasesPath then
        config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases"
        config.vm.provision "shell" do |s|
          s.inline = "awk '{ sub("r$", ""); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases"
        end
    end
    if File.exist? homesteadYamlPath then
        settings = YAML::load(File.read(homesteadYamlPath))
    elsif File.exist? homesteadJsonPath then
        settings = JSON.parse(File.read(homesteadJsonPath))
    end
    Homestead.configure(config, settings)
    if File.exist? afterScriptPath then
        config.vm.provision "shell", path: afterScriptPath, privileged: false
    end
    if defined? VagrantPlugins::HostsUpdater
        config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] }
    end
end

它的节目需要更高版本的流浪者,所以我只是命令了该行。

这是我的homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: *******"
name: *******"
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
    - ~/.ssh/id_rsa
folders:
    - map: "/Users/*******"
      to: "/home/vagrant//*******""
sites:
    - map: *******.app
      to: "/home/vagrant/*******/public"
databases:
    - *******
# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar
# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

我知道,通过升级我的虚拟框和Vagrant版本,它将解决该问题。但是我在当前虚拟框中丢失了现有的Laravel项目。如果我升级了我的盒子,它将显示我较旧的应用程序的错误。

任何人可以帮助我如何克服这一点?

在您的homestead.yaml文件中,看来称为'名称'的设置是给您悲伤的原因。我会尝试评论该行以查看是否有帮助。

ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: *******"
# name: *******" <----- THIS LINE HERE
provider: virtualbox

如果您想使用旧版本的Homestead,我会考虑使用"版本"设置。

请参阅此处:https://laravel.com/docs/5.4/homestead#old-versions

编辑:示例homestead.yaml

ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
    - ~/.ssh/id_rsa
folders:
    - map: ~/Code
      to: /home/vagrant/Code
sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public
databases:
    - homestead

最新更新