2016-10-14 2 views
0

при установке нового экземпляра бродяг, я получаю эту ошибку при использовании vagrant up. Здесь ошибкаПроблема с бродягой при использовании бродяги вверх

Vagrant failed to initialize at a very early stage: 

There is a syntax error in the following Vagrantfile. The syntax error 
message is reproduced below for convenience: 

/mnt/c/Users/bilal/Homestead/scripts/homestead.rb:141: syntax error, unexpected tPOW 
...ype: folder["type"] ||= nil, **options 
...        ^
/mnt/c/Users/bilal/Homestead/scripts/homestead.rb:157: syntax error, unexpected keyword_do_block, expecting keyword_end 
     settings["sites"].each do |site| 
          ^
/mnt/c/Users/bilal/Homestead/scripts/homestead.rb:207: syntax error, unexpected keyword_do_block, expecting keyword_end 
     settings["databases"].each do |db| 
            ^
/mnt/c/Users/bilal/Homestead/scripts/homestead.rb:208: syntax error, unexpected tSTRING_BEG, expecting keyword_end 
      config.vm.provision "shell" do |s| 
          ^
/mnt/c/Users/bilal/Homestead/scripts/homestead.rb:208: syntax error, unexpected keyword_do_block, expecting keyword_end 
      config.vm.provision "shell" do |s| 
             ^
/mnt/c/Users/bilal/Homestead/scripts/homestead.rb:220: syntax error, unexpected keyword_end, expecting $end 

Вот мое содержание VagrantFile

# -*- mode: ruby -*- 
# vi: set ft=ruby : 

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.require_version '>= 1.8.4' 

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 
    if File.exist? aliasesPath then 
     config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases" 
    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 

=========================== =================================

И является файл 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: /mnt/e/XAMPP/htdocs 

sites: 
    - map: homestead.app 
     to: /mnt/e/XAMPP/htdocs/cap/web 

databases: 
    - homestead 
+1

Можете ли вы показать нам свой Vagrantfile? – k0chan

+0

включает также ваш файл yaml. –

+0

Добавлен оба содержимого файла. –

ответ

1

Решила эту проблему, обновив Vagrant до 1.8.4.

Смежные вопросы