`bind': Address already in use --bind (2) for 127.0.0.1:3000 (Errno :: EADDRINUSE) How to deal with the error

Event

When I stopped the server while doing something, when I tried to start the server again, the following error occurred.

`bind': Address already in use - bind(2) for 127.0.0.1:3000 (Errno::EADDRINUSE)

Cause and remedy

Error that port 3000 is already in use. There are two solutions

  1. Use another port
  2. Turn off the process being used

1. Use another port

If the 3000th boat is used, you can start the server using another port.

#Start up on a port other than 3000
rails s -p 8000

2. Turn off the process being used

Check the currently running ruby ​​process

$ ps -ax | grep ruby

If there is a running process, it will be displayed as follows.

6462 ttys011    0:12.64 /Users/*****/.rbenv/versions/2.5.3/bin/ruby bin/rails server
8380 ttys011    0:00.00 grep ruby

Kill the running rails process.

$ kill 6462

Check if the process has been killed

$ ps -ax | grep ruby
6462 ttys011    0:12.64 /Users/*****/.rbenv/versions/2.5.3/bin/ruby bin/rails server
8380 ttys011    0:00.00 grep ruby

It seems that it is not cut, so add an option to the kill command and forcibly kill it

# "-9"Is a kill option
$ kill -9 6462

#Reconfirm process
$ ps -ax | grep ruby
 8405 ttys011    0:00.00 grep ruby

Now that the rails process is dead, the rails server should be up and running.

reference

-Solution for error "Address already in use --bind (2) for" 0.0.0.0 "port 3000" at rails s [Beginner]

-rails s does not pass

-[Kill] Command to kill process on Linux

Recommended Posts

`bind': Address already in use --bind (2) for 127.0.0.1:3000 (Errno :: EADDRINUSE) How to deal with the error
How to deal with the error ERROR: While executing gem ... (Gem :: FilePermissionError)
How to deal with the error yaml.scanner.ScannerError: while scanning for the next token that appeared in Rails environment construction with Docker
How to deal with 405 Method Not Allowed error in Tomcat + JSP
Solution for error with for db Cannot start service db: Ports are not available: listen tcp 0.0.0.0:5432: bind: address already in use in Docker
How to use nginx-ingress-controller with Docker for Mac
How to deal with fatal: remote origin already exists.
How to deal with No template for interactive request
How to use Z3 library in Scala with Eclipse
Organized how to interact with the JDK in stages
How to use JDD library in Scala with Eclipse
How to use git with the power of jgit in an environment without git commands
How to deal with Selenium :: WebDriver :: Error :: UnknownError that occurs in Dokcer environment etc.
Summary of how to use the proxy set in IE when connecting with Java
How to create a placeholder part to use in the IN clause
Uppercase only the specified range with substring. (How to use substring)
How to use the same Mapper class in multiple data sources with Spring Boot + MyBatis
wsimport error handling (A class / interface with the same name "xxx" is already in use)
How to use the link_to method
How to use Lombok in Spring
[Rails / RSpec] How to deal with element has zero size error
How to use the include? method
How to use the form_with method
How to use the wrapper class
How to use mssql-tools with alpine
[Java] How to search for a value in an array (or list) with the contains method
How to use InjectorHolder in OpenAM
How to use classes in Java?
How to solve the unknown error when using slf4j in Java
How to deal with the event that Committee :: InvalidRequest occurs in committee during Rspec file upload test
Address already in use workaround (Windows)
How to deal with the type that I thought about writing a Java program for 2 years
How to use MinIO with the same function as S3 Use docker-compose
[Cloud9] Address already in use [Solution]
[For those who create portfolios] How to use binding.pry with Docker
[Rails] How to get the user information currently logged in with devise
How to display the text entered in text_area in Rails with line breaks
[Rails] How to apply the CSS used in the main app with Administrate
How to bind request parameters in list format with bean property in Spring
Multilingual Locale in Java How to use Locale
How to use binding.pry for view files
[Java] How to use the File class
How to use custom helpers in rails
[Java] How to use the hasNext function
How to use named volume in docker-compose.yml
[Android] How to deal with dark themes
How to put out the error bundling
How to use BootStrap with Play Framework
[Rails] How to use rails console with docker
[Java] How to use the HashMap class
[Rails] How to use the map method
[Java] How to use the toString () method
Studying how to use the constructor (java)
[Processing × Java] How to use the loop
How to use MySQL in Rails tutorial
[Ruby] How to use slice for beginners
[Processing × Java] How to use the class
How to get the date in java
[Processing × Java] How to use the function
How to use environment variables in RubyOnRails
[Java] How to use the Calendar class