Uday's website
Published on Uday's website (https://www.uday.net)

Home > Rails error - Address already in Use - Lessons Learned 7

Rails error - Address already in Use - Lessons Learned 7 [1]

Submitted by uday [2] on February 13, 2023 - 10:00pm

When I tried to start rails server $rails s

I was getting following error.

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

This meant that the process was running already.

How I fixed it?

$ lsof -wni tcp:3000
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ruby    55037 uday   15u  IPv4 359795      0t0  TCP 127.0.0.1:3000 (LISTEN)
ruby    55037 uday   16u  IPv6 359796      0t0  TCP [::1]:3000 (LISTEN)
$ kill -9 55037  # 55037 is the process id.
$ lsof -wni tcp:3000
$ rails s
Rating: 

 Valid XHTML 1.0 StrictCreative Commons LicenseVerbatim copying and redistribution of this entire page are permitted provided this notice is preserved. All content on this website including archives (including text, photographs, audio files and any other original work), unless otherwise noted, is licensed under a Creative Commons License or later.


Source URL:https://www.uday.net/rails-error-address-already-in-use

Links
[1] https://www.uday.net/rails-error-address-already-in-use [2] https://www.uday.net/user/1