現象
- サーバ起動オプションでポート3030を指定したのに、listenするポートが3000に変わっている。
$ rails s -p 3030
=> Booting Puma
=> Rails 5.0.1 application starting in development on http://localhost:3030
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.7.0 (ruby 2.4.0-p0), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
対処
- webrickを使ってる時はこんなことはなかった。
- ググっているといろんな人が「pumaのバグなんじゃないのか?」と言ってる。
- 一時的にはこのように現象を回避する
env PORT=3030 rails s
これで
* Listening on tcp://0.0.0.0:3030
を得ることができる。
とりあえずメモ。