0
0

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実行時に Address already in use が発生した時の対処法

Posted at

rails s実行時に

in `initialize': Address already in use - bind(2) for "::1" port 3000 (Errno::EADDRINUSE)

と表示され、ローカルサーバが起動しなくなった時の対処法。

調べてみるとすでに0.0.0.0:3000が使われてしまっているというエラー表示のため、

lsof -i:3000
COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
ruby    38514        29u  IPv6 0x88vsddsreb9f0a63      0t0  TCP localhost:hbci (LISTEN)
ruby    38514        30u  IPv4 0x88ssffsbbdfsbbbb      0t0  TCP localhost:hbci (LISTEN)

ポート3000番使用PIN確認すると2つのUSERが使用中。

kill -9 38514

PIN番号指定してkill

再度rails sすると無事サーバーが立ち上がりました。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?