To solve Address already in use – bind(2) for “127.0.0.1” port 3000 (Errno::EADDRINUSE) or error similar to Rails : Address already in use – bind(2) for port (Errno::EADDRINUSE). Use any one of the given methods.
Method 1:
In order to solve you need to first kill the process ID i.e., PID. You can get the PID by running the below command. If you are running on port 3000 then use:
lsof -wni tcp:3000
Once you get the PID from the above command then run:
kill -9 PID_num
Method 2:
You can also modify the tcp port to any other port that is not currently in use. Let’s say we are modifying port from 3000 to 3005 then use:
bundle exec puma -C config/puma.rb -b tcp://127.0.0.1:3005
Similar Errors :
ModuleNotFoundError: No module named ‘pip._internal.cli’