194
183

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Last updated at Posted at 2015-01-07

対象: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をインストールして最初にはまったこと

194
183
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
194
183

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?