When I try to start the server with rails s, I get an error and the server cannot start. Error: "port3000 is already in use"
`initialize': Address already in use - bind(2) for "127.0.0.1" port 3000 (Errno::EADDRINUSE)
The port3000 you want to use is being used by an old process in the past and is preventing the new process from starting the server.
mao-no-MacBook-Air:hello_world_sample mao$ lsof -i:3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ruby 30406 mao 12u IPv4 0x982d8086b787a0bb 0t0 TCP localhost:hbci (LISTEN)
ruby 30406 mao 13u IPv6 0x982d8086b93685bb 0t0 TCP localhost:hbci (LISTEN)
mao-no-MacBook-Air:hello_world_sample mao$ kill 30406
mao-no-MacBook-Air:hello_world_sample mao$ rails s
/Users/mao/.rbenv/versions/2.7.1/lib/ruby/2.7.0/x86_64-darwin17/stringio.bundle: warning: already initialized constant StringIO::VERSION
=> Booting Puma
=> Rails 6.0.3.2 application starting in development
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 4.3.5 (ruby 2.7.1-p83), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://127.0.0.1:3000
* Listening on tcp://[::1]:3000
Use Ctrl-C to stop
Recommended Posts