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

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

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

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Laravel 5

Laravel 5は、PHPフレームワークLaravelの最新バージョンで、2014年11月に発表予定です。ディレクトリ構造がが現行版より大幅に変更されるほか、メソッドインジェクションやFormRequestの利用が可能になります。

Q&A

解決済

2回答

1493閲覧

Homestead + Laravelで Vagrant upが出来ない

majua51

総合スコア7

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Laravel 5

Laravel 5は、PHPフレームワークLaravelの最新バージョンで、2014年11月に発表予定です。ディレクトリ構造がが現行版より大幅に変更されるほか、メソッドインジェクションやFormRequestの利用が可能になります。

0グッド

0クリップ

投稿2019/12/16 00:42

編集2019/12/16 01:25

Laravel + Homesteadで開発をしています。
普段の環境では問題無かったのですが、帰省先の環境でvagrant upをすると

The specified host network collides with a non-hostonly network! This will cause your specified IP to be inaccessible. Please change the IP or name of your host only network so that it no longer matches that of a bridged or non-hostonly network. Bridged Network Address: '192.168.10.0' Host-only Network 'en0: Wi-Fi (AirPort)': '192.168.10.0'

というエラーが出てしまいます。

こちらの記事を参考にhomestead.yamlのIPをip: 192.168.20.10に書き換えてみたのですが
今度は

==> homestead: Booting VM... ==> homestead: Waiting for machine to boot. This may take a few minutes... homestead: SSH address: 127.0.0.1:2222 homestead: SSH username: vagrant homestead: SSH auth method: private key homestead: Warning: Connection reset. Retrying... homestead: Warning: Remote connection disconnect. Retrying... --- homestead: Warning: Connection reset. Retrying... homestead: Warning: Remote connection disconnect. Retrying... homestead: Warning: Connection reset. Retrying... homestead: Warning: Remote connection disconnect. Retrying...

と延々と接続にリトライしては失敗する状態が続いています。
恐らくSSHで接続が出来ないのだとは思うのですが、どこをどうすれば良いのかさっぱり分かりません。

vagrantfileは以下の通りです。

vagrantfile

1# -*- mode: ruby -*- 2# vi: set ft=ruby : 3 4require 'json' 5require 'yaml' 6 7VAGRANTFILE_API_VERSION ||= "2" 8confDir = $confDir ||= File.expand_path(File.dirname(__FILE__)) 9 10homesteadYamlPath = confDir + "/Homestead.yaml" 11homesteadJsonPath = confDir + "/Homestead.json" 12afterScriptPath = confDir + "/after.sh" 13customizationScriptPath = confDir + "/user-customizations.sh" 14aliasesPath = confDir + "/aliases" 15 16require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb') 17 18Vagrant.require_version '>= 2.2.4' 19 20Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 21 if File.exist? aliasesPath then 22 config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases" 23 config.vm.provision "shell" do |s| 24 s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases && chown vagrant:vagrant /home/vagrant/.bash_aliases" 25 end 26 end 27 28 if File.exist? homesteadYamlPath then 29 settings = YAML::load(File.read(homesteadYamlPath)) 30 elsif File.exist? homesteadJsonPath then 31 settings = JSON::parse(File.read(homesteadJsonPath)) 32 else 33 abort "Homestead settings file not found in #{confDir}" 34 end 35 36 Homestead.configure(config, settings) 37 38 if File.exist? afterScriptPath then 39 config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true 40 end 41 42 if File.exist? customizationScriptPath then 43 config.vm.provision "shell", path: customizationScriptPath, privileged: false, keep_color: true 44 end 45 46 if Vagrant.has_plugin?('vagrant-hostsupdater') 47 config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] } 48 elsif Vagrant.has_plugin?('vagrant-hostmanager') 49 config.hostmanager.enabled = true 50 config.hostmanager.manage_host = true 51 config.hostmanager.aliases = settings['sites'].map { |site| site['map'] } 52 end 53 54 if Vagrant.has_plugin?('vagrant-notify-forwarder') 55 config.notify_forwarder.enable = true 56 end 57end 58

その他必要な情報がございましたらご指摘下さいませ。
よろしくお願いいたします。

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

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

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

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

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

yoorwm

2019/12/16 01:06

よく分からないまま、Vagrantfileを編集しましたか? 添付されたものだとエラーが出るはずなので、Vagrantfile全体を貼り付けてみてください。
majua51

2019/12/16 01:25

失礼しました、一部しか添付できてませんでしたので全体を貼り付けました。
guest

回答2

0

vagrant destroyで作り直すことで上手くいきました。

投稿2019/12/16 04:13

majua51

総合スコア7

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

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

0

ベストアンサー

Vagrantfileは一切触らなくていい。

Homestead.yamlのipは各自の環境に合わせて設定するしかない。
初回にリトライ続くことは多いのでしばらく待ってみるとかdestroyして作り直すとか。

投稿2019/12/16 03:01

kawax

総合スコア10377

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

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

majua51

2019/12/16 04:12

ありがとうございます。 何度か試して見たのですがやはり上手くいかないため、destroyで作り直したところ無事動くようになりました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問