前提・実現したいこと
vagrantコマンドが実行出来る様になる
vagrant up
vagrant ssh
vagrant destroy
vagrant global-status
などのvagrantコマンドを実行すると同じエラーが出てしまいます。
発生している問題・エラーメッセージ
下記はdestroyコマンドを実行した場合の例です。
※他のvagrantコマンドを使っても同じエラーとなります。
nekonoMacBook-Air:homestead neko$ vagrant destroy /opt/vagrant/embedded/lib/ruby/2.4.0/psych.rb:377:in `parse': (<unknown>): could not find expected ':' while scanning a simple key at line 3 column 1 (Psych::SyntaxError) from /opt/vagrant/embedded/lib/ruby/2.4.0/psych.rb:377:in `parse_stream' from /opt/vagrant/embedded/lib/ruby/2.4.0/psych.rb:325:in `parse' from /opt/vagrant/embedded/lib/ruby/2.4.0/psych.rb:252:in `load' from /Users/neko/app/Homestead/Vagrantfile:29:in `block in <top (required)>' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/v2/loader.rb:37:in `load' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:119:in `each' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:119:in `block in load' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:116:in `each' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/config/loader.rb:116:in `load' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/vagrantfile.rb:29:in `initialize' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/environment.rb:792:in `new' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/environment.rb:792:in `vagrantfile' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/environment.rb:973:in `process_configured_plugins' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/environment.rb:178:in `initialize' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/bin/vagrant:145:in `new' from /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/bin/vagrant:145:in `<main>'
###vagrantfile
# -*- mode: ruby -*- # vi: set ft=ruby : require 'json' require 'yaml' VAGRANTFILE_API_VERSION ||= "2" confDir = $confDir ||= File.expand_path(File.dirname(__FILE__)) homesteadYamlPath = confDir + "/Homestead.yaml" homesteadJsonPath = confDir + "/Homestead.json" afterScriptPath = confDir + "/after.sh" customizationScriptPath = confDir + "/user-customizations.sh" aliasesPath = confDir + "/aliases" require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb') Vagrant.require_version '>= 2.2.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 && chown vagrant:vagrant /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)) else abort "Homestead settings file not found in #{confDir}" end Homestead.configure(config, settings) if File.exist? afterScriptPath then config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true end if File.exist? customizationScriptPath then config.vm.provision "shell", path: customizationScriptPath, privileged: false, keep_color: true end if Vagrant.has_plugin?('vagrant-hostsupdater') config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] } elsif Vagrant.has_plugin?('vagrant-hostmanager') config.hostmanager.enabled = true config.hostmanager.manage_host = true config.hostmanager.aliases = settings['sites'].map { |site| site['map'] } end if Vagrant.has_plugin?('vagrant-notify-forwarder') config.notify_forwarder.enable = true end end
補足情報(FW/ツールのバージョンなど)
mac os
先ほどまでvagrantは実行できてましたが、laravelの新規プロジェクトを一から生成しようと違うディレクトリに移動した際にvagrantが実行できないことに気づきました。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/05 00:19
2019/08/05 03:18
2019/08/05 03:19
2019/08/05 03:47
2019/08/05 03:54
2019/08/05 03:57