LoginSignup
0
0

More than 3 years have passed since last update.

Railsサーバーが立ち上がらない。

Last updated at Posted at 2020-12-13

エラー内容

rails sでサーバーの起動を試みた際、以下のエラーが発生。

: Address already in use - bind(2) for "127.0.0.1" port 3000 (Errno::EADDRINUSE)

3000番ポート使われていると怒られる。

現在起動しているサーバーのプロセスを確認してみる。

$ ps aux | grep puma

30254のプロセスが邪魔をしている様子。 
26491のプロセスは、ps aux | grep pumaコマンド自体のプロセスとのこと。

shiro            30254   0.0  0.1  4455312  15532   ??  S     2:03PM   0:05.23 puma 3.12.6 (tcp://localhost:3000) [portfolio_01]
shiro            26491   0.0  0.0  4258892    224 s000  R+    9:53PM   0:00.00 grep --color=auto puma

プロセスを強制終了させる。

$ kill 30254

その他(別ポートで立ち上げる)

手っ取り早く解決する方法。根本的な解決ではないためオススメできませんが、以下のように打てば別ポートで立ち上がります。

$ rails s -p 3001

終わりに

Railsの設定等々を行っている際、かなりの時間をこのエラーに費やしてしまいました。
私と同じく初学者の方にお役に立てればと思い投稿します。
ご参考ください。

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