Recently, I decided to study Laravel and to work with it and I needed homestead. I found the installation instructions https://www.youtube.com/watch?v=9BM72cuBKtM and followed it.

At step 16, when trying to raise vagrant, it gives a number of errors.

/home/wolf/Homested/scripts/homestead.rb:138: syntax error, unexpected tPOW ...ype: folder["type"] ||= nil, **options ... ^ /home/wolf/Homested/scripts/homestead.rb:149: syntax error, unexpected keyword_do_block, expecting keyword_end settings["sites"].each do |site| ^ /home/wolf/Homested/scripts/homestead.rb:191: syntax error, unexpected keyword_do_block, expecting keyword_end settings["databases"].each do |db| ^ /home/wolf/Homested/scripts/homestead.rb:192: syntax error, unexpected tSTRING_BEG, expecting keyword_end config.vm.provision "shell" do |s| ^ /home/wolf/Homested/scripts/homestead.rb:192: syntax error, unexpected keyword_do_block, expecting keyword_end config.vm.provision "shell" do |s| ^ /home/wolf/Homested/scripts/homestead.rb:202: syntax error, unexpected keyword_end, expecting $end 

Unfortunately, I do not understand the syntax of this Vagrant configuration file.

The file itself contains the following information:

  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 settings = YAML::load(File.read(homesteadYamlPath)) elsif File.exists? homesteadJsonPath then settings = JSON.parse(File.read(homesteadJsonPath)) end Homestead.configure(config, settings) if File.exists? afterScriptPath then config.vm.provision "shell", path: afterScriptPath 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 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 # blackfire: # - id: foo # token: bar # client-id: foo # client-token: bar # ports: # - send: 50000 # to: 5000 # - send: 7777 # to: 777 # protocol: udp 

Please tell me what you need to fill out and fix to raise a vagrant for homestead.

  • Video tutorial for almost a year, hmm. It looks like the code is executed on too old Ruby, which still doesn’t have a hash remainder (**). What does ruby -v print? - D-side
  • I have ruby ​​2.0 since yesterday. I tried. Then he put another 2.3. However, it does not work. - Basil Jimmy

0