..$ 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
=>
Run this command -
lsof -wni tcp:3000
then you will get the following table -
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ruby 2552 shyam 17u IPv4 44599 0t0 TCP 127.0.0.1:3000 (LISTEN)
ruby 2552 shyam 18u IPv6 44600 0t0 TCP [::1]:3000 (LISTEN)
Run this command and replace PID from the Above table
kill -9 PID
example:
kill -9 2552