..$ rails s
=> Booting WEBrick
=> Rails 4.0.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=>
the gui way for Windows user
open the ResourceMonitor (taskmanager ->Performance -> ResourceMonitor) and kill the ruby.exe process
Kill server.pid by using command:
kill -9 `cat /root/myapp/tmp/pids/server.pid`
Note: Use your server.pid path which display in console/terminal.
Thank you.
First Find PID # - where the Rails Server got stuck on
Run this to find the stuck PID
cat ./tmp/pids/server.pid
It will return something like 65829
Then KILL that PID => kill 65829
Open the path/to/your/rails/project/tmp/pids/server.pid
file.
Copy the number you find therein.
Run kill -9 [PID]
Where [PID]
is the number you copied from the server.pid
file.
This will kill the running server process and you can start your server again without any trouble.
Run given below command on terminal ( for linux only )
ps aux | grep rails
and then
kill -9 [pid]
Another way
lsof -wni tcp:3000
and then
kill -9 [PID]
Short and Crisp single line command, that will take care of it.
kill -9 $(lsof -i tcp:3000 -t)