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

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

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

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

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

Q&A

解決済

2回答

2331閲覧

vagrantコマンドを実行すると同じエラーが出て先に進まない。

Ms.yy

総合スコア83

Laravel

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

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

0グッド

0クリップ

投稿2019/08/04 23:21

編集2019/08/05 13:21

問題点

vagrant up
vagrant ssh
vagrant destroy
vagrant global-status
などのvagrantコマンドを実行すると同じエラーが表示される。

発生している問題・エラーメッセージ

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'.

###app/homestead/resources/localized/vagrantfile

# -*- 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 = File.expand_path("Homestead.yaml", File.dirname(__FILE__)) homesteadJsonPath = File.expand_path("Homestead.json", File.dirname(__FILE__)) afterScriptPath = "after.sh" customizationScriptPath = "user-customizations.sh" aliasesPath = "aliases" require File.expand_path(confDir + '/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" 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 " + File.dirname(__FILE__) 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 end

###app/homestead/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

###Homestead.json

{ "ip": "192.168.10.10", "memory": 2048, "cpus": 2, "provider": "virtualbox", "authorize": "~/.ssh/id_rsa.pub", "keys": [ "~/.ssh/id_rsa" ], "folders": [ { "map": "~/code", "to": "/home/vagrant/code" } ], "sites": [ { "map": "homestead.test", "to": "/home/vagrant/code/public" } ], "databases": [ "homestead" ], "features": [ { "mariadb": false }, { "ohmyzsh": false }, { "webdriver": false } ] }

試したこと

vagrant plugin install vagrant-share --plugin-version 1.1.8
実行後今回のエラーが表示される様になりました。

vagrant plugin uninstall vagrant-share実行後vagrantコマンドで下記のエラーに変わりました。

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'. nekonoMacBook-Air:homestead neko$ vagrant plugin uninstall vagrant-share Uninstalling the 'vagrant-share' plugin... Successfully uninstalled vagrant-share-1.1.8 nekonoMacBook-Air:homestead neko$ vagrant up /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>'

 

補足情報(FW/ツールのバージョンなど)

mac os

vagrant -v
Vagrant 2.2.5

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

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

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

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

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

guest

回答2

0

まずはpluginのアンインストールを試されると良いと思います。

vagrant plugin uninstall vagrant-share

投稿2019/08/05 00:13

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

Ms.yy

2019/08/05 03:16

まずは、そちらを実行してみようと思います! ありがとうございます^^
Ms.yy

2019/08/05 10:31

完了しました、 その後vagrantコマンドを実行したら新たなエラーが出てしまいました。汗
guest

0

ベストアンサー

vagrant plugin install vagrant-share --plugin-version 1.1.8

にて、古いバージョンのプラグインをインストールしてしまったことが原因と考えられます。

手っ取り早い方法は、一度Vagrant本体をインストールし直し、最新のプラグインをインストールする、でしょうか。

投稿2019/08/04 23:39

kazto

総合スコア7196

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

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

Ms.yy

2019/08/04 23:41

わかりました。再インストールを試してみます^^
Ms.yy

2019/08/05 10:33

一旦プラグインをアンインストールしてみて新たなエラーが出てしまったので、どうしてもだめな場合は丸ごとインストールし直してみます
kazto

2019/08/05 12:31

ちなみに、Vagrantfileの内容はどのようになっていますか?コメントではなく、質問に追記する形で記載していただけると助かります。
Ms.yy

2019/08/05 12:36

失礼しました。 vagrantfile2つありましたので両方追記させていただきました!
kazto

2019/08/05 12:56

なるほど、Homesteadを起動しようとしてコケてるのですね。 そして、おそらくHomestead.jsonを読み込もうとして、エラーとなっている。 Homestead.jsonの内容はどのようになっていますか?
Ms.yy

2019/08/05 13:20

エラーの流れをまとめますと、 1.vagrantコマンドが「Psych::SyntaxError」となり実行されない。 2.ネットで調べて「vagrant plugin install vagrant-share --plugin-version 1.1.8」を実行した。 3.しかし、vagrantコマンドを実行しても「An unexpected error ・・・」と表示される(こちらの議題) 4.プラグインアンインストールとvagrant再インストール実行(こちらの擬態のアンサー) 5.再び1.のエラーに戻る 6.新しい質問をteratailで投げかけている→NEW URL:https://teratail.com/questions/204527# といった感じです????
Ms.yy

2019/08/05 13:35

Homestead.jsonUPいたしました
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問