質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

Q&A

解決済

1回答

396閲覧

laravelでvagrantコマンドを実行するとエラー(Psych::SyntaxError)となる

Ms.yy

総合スコア83

Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

0グッド

0クリップ

投稿2019/08/04 22:40

編集2019/08/05 11:09

前提・実現したいこと

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が実行できないことに気づきました。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

vagrant plugin install vagrant-share --plugin-version 1.1.8
を行ってから、vagrantコマンドを実行するとエラー文が変わりました。

エラー文はこちらで引き続き質問しております。
URL teratail

  • vagrant up
  • vagrant ssh
  • vagrant destroy
  • vagrant global-status
nekonoMacBook-Air:homestead neko$ vagrant up An unexpected error occurred while loading the vagrant-login plugin. Please contact support with the following error code: '7'.

投稿2019/08/04 23:08

編集2019/08/05 03:49
Ms.yy

総合スコア83

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

m.ts10806

2019/08/05 00:19

>すると挙動が変わりました。 どのように変わったのか、結果どのようにして解決になったのか具体的に記載されたほうが あとから見た人の参考になると思います。
Ms.yy

2019/08/05 03:18

訂正させて頂きました。 いつもありがとうございます。^^
m.ts10806

2019/08/05 03:19

なるほど、エラーが変わっただけで根本解決に至ったわけではないということですね(本来なら新しい質問を立てないほうが良さそう)
Ms.yy

2019/08/05 03:47

そうです、解決にはならなかったのですが、 こちらの質問と違うため、新しい質問を立ててしまいました・・・
m.ts10806

2019/08/05 03:54

了解です。確かに微妙なところですね。 次に同じようなことがあれば「試したこと」に状況を記載しておくと根本解決までの流れが分かって、 後から見る人には良いかもしれません。
Ms.yy

2019/08/05 03:57

了解しました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問