Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
184
Help us understand the problem. What is going on with this article?
@tmf16

rails sで起動したサーバにブラウザからアクセスできない

More than 5 years have passed since last update.

対象:Rails4.2

Railsのバージョンを4.2に上げてブラウザからアクセスしようとしたら繋がらない。

$ ./bin/rails s
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server

起動時のアドレスがlocalhostになっている
これだと外部からのアクセスが繋がらないのでip指定して起動

$ ./bin/rails s -b 0.0.0.0
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server

これで外部からアクセス可能となる。4.2から変わったみたい。

参考
Rails4.2beta1をインストールして最初にはまったこと

184
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
tmf16

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
184
Help us understand the problem. What is going on with this article?