前提・実現したいこと
railsアプリを勉強している初心者です。
railsの開発に関してお伺いしたいことがあり投稿致しました。
仮想マシン上でrailsアプリを作成した際、アプリ作成時は、サーバーアプリの起動からブラウザでのサイトの表示まで、成功するのですが、
後日、仮想マシンを立ち上げ、サーバーアプリを起動し、ブラウザでサイトを表示しようとすると、
下記のような状態になり、サーバーの起動を停止することもできなくなります。
発生している問題・エラーメッセージ
[vagrant@localhost test_app]$ bundle exec rails s
=> Booting Puma
=> Rails 5.1.4 application starting in development
=> Run rails server -h
for more startup options
Puma starting in single mode...
- Version 3.11.2 (ruby 2.5.0-p0), codename: Love Song
- Min threads: 5, max threads: 5
- Environment: development
- Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Started GET "/" for 192.168.33.1 at 2018-03-08 08:19:13 +0000
Cannot render console from 192.168.33.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Started GET "/" for 192.168.33.1 at 2018-03-08 08:19:14 +0000
Cannot render console from 192.168.33.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
(1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
(1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
ポートを変更して起動すると、通ります。
[vagrant@localhost test_app]$ bundle exec rails s -b 0.0.0.0 -p 3001
=> Booting Puma
=> Rails 5.1.4 application starting in development
=> Run rails server -h
for more startup options
Puma starting in single mode...
- Version 3.11.2 (ruby 2.5.0-p0), codename: Love Song
- Min threads: 5, max threads: 5
- Environment: development
- Listening on tcp://0.0.0.0:3001
Use Ctrl-C to stop
Started GET "/" for 192.168.33.1 at 2018-03-08 08:11:12 +0000
Cannot render console from 192.168.33.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
(1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
Processing by Rails::WelcomeController#index as HTML
Rendering vendor/bundle/ruby/2.5.0/gems/railties-5.1.4/lib/rails/templates/rails/welcome/index.html.erb
Rendered vendor/bundle/ruby/2.5.0/gems/railties-5.1.4/lib/rails/templates/rails/welcome/index.html.erb (19.5ms)
Completed 200 OK in 173ms (Views: 120.3ms | ActiveRecord: 0.0ms)
試したこと
・rails db:migrate → 変わらず
・仮想マシンをシャットダウン→再起動→サーバーアプリ起動→変わらず
・ポート番号を変えて起動→通る
いろいろ試してはみたのですが、原因がわかりませんでした。
お手数ではありますが、お力添えして頂ければと思います。
よろしくお願い申し上げます。
補足情報(FW/ツールのバージョンなど)
ホストOS:windows10
ゲストOS:CentOS7
仮想マシン構築ツール
vagrant (2.0.1)
VirtualBox (5.2.6)
仮想マシン上での開発環境
ruby (2.5.0)
rails (5.1.4)
bundler (1.16.1)
bundler以外のGemは(rails含めて)アプリケーションフォルダ内のvendor/bundleフォルダ内にインストールしている
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/03/17 08:48
2018/03/17 11:36
退会済みユーザー
2018/03/18 06:42
2018/03/18 07:10
退会済みユーザー
2018/03/18 12:48