Reputation: 7280
I am trying to start rails server using rails s
command. But i'm getting the following error:
A server is already running. Check repo/tmp/pids/server.pid.
I checked the file, but its blank. There is no id in the server.pid file. Then I tried to find out the process running on port 3000 using the command lsof -wni tcp:3000
. It also does not show any id.
Then I tried starting the server on a different port using rails s -p 3001
, but this also gives the same error. Please could someone explain what is going on.
Thanks
EDIT: does not work even after restarting computer
Upvotes: 0
Views: 108
Reputation: 191
1- Use the command below for checking that how many server currently running
$ ps aux | grep rails
2- For killing the existing server
$ kill -9 pid
Upvotes: 0
Reputation: 2689
Try running this command in your terminal window.
kill -9 $(lsof -i tcp:3000 -t)
If it doesn't work, you can always just restart your computer/server...
Upvotes: 0