2017-02-27 1 views
0

laravel homestead에서 가상 호스트에 대해 Vagrant 및 Virtual box를 사용하고 있습니다. 내가 방랑자를 주면 다음과 같은 오류가 발생합니다.Mac : Laravel homestead - Vagrant up 오류

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 

내가 아는이고 방랑 버전이 문제가 해결됩니다. 하지만 현재의 가상 박스에서 기존의 라 라벨 프로젝트를 잃어 버렸습니다. 내 상자를 업그레이드하면 이전 응용 프로그램의 오류가 표시됩니다.

아무도 나를 극복하는 방법을 도울 수 있습니까?

답변

0

homestead.yaml 파일에 '이름'이라는 설정이있어 슬픔을주고있는 것으로 보입니다. 도움이되는지 확인하기 위해 그 라인을 주석 처리하려고합니다.

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

홈스테드의 이전 버전을 사용하려는 경우 '버전'설정을 사용합니다.

여기를 참조하십시오 : 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 
+0

우수함. 우리가 가까이 있기를 바랍니다. 하지만 지금은 기본 컴퓨터 이름과 다음과 같은 오류가 발생하고 있습니다 : '가상 주택'공급자와 함께 '홈스테드 - 7'컴퓨터 가져 오기 ... 이 컴퓨터의 구성에 오류가 있습니다. 다음과 같은 오류를 수정하시기 바랍니다 다시 시도 : 쉘 제공자 : * 다음 설정이 존재하지 않아야 다음 설정이 존재하지 않아야 * 이름 : 이름 * 다음과 같은 설정이 존재하지 않아야 이름 * 다음 설정이 없어야합니다. 이름 * 다음 설정이 없어야합니다. 이름 * 다음 설정이 없어야합니다. 이름 – Muthu17

+0

정확히 같은 오류가있는 것 같습니다. 호스트 이름 행을 주석으로 처리하십시오. 나는 또한 내가 가지고있는 샘플 Homestead.yaml 파일을 게시 할 것이다. 나는 당신이 '이름'또는 '호스트 이름'이 필요하다고 생각하지 않는다. 모든 호스트 이름은 별도의 파일 (/ etc/hosts)을 통해 수행되어야합니다. –

관련 문제