Can't start Rails server - "Address In Use"


Hello! May I kindly ask for help?

When I start rails server it gets loaded and then immediately exits like this:

[7112] * Listening on tcp://
/usr/local/rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/binder.rb:255:in `initialize’: Address already in use - bind(2) for “” port 8080 (Errno::EADDRINUSE)

Is there any way out?
Thank you!


run lsof -i :8080 to see processes that listen on that port, then run kill on that process.

you can use the following to do that automatically

openPort() {
    local PID=$(sudo lsof -t -i :$1)
    [ "$PID" != "" ] && sudo kill -9 $PID
    sleep 0.1
    echo killed $PID listening on $1: $(sudo lsof -t -i :$1)
openPort 8080


Thank you so much! That’s very useful to know! I resolved this by restarting my workspace.