3
votes

Another newbie moment- I am trying to run a local server in cloud 9 IDE. It seems that I already have another server running. I tried to kill it using : rake tmp:clear

That didn't seem to work.

Here is the message I am getting :

=> Booting Puma => Rails 5.0.0.rc2 application starting in development on http://0.0.0.0:8080 => Run rails server -h for more startup options A server is already running. Check /home/ubuntu/workspace/sample_app/tmp/pids/server.pid. Exiting

As always, thanks in advance for your help.

J

4
When I run lsof -wni tcp:3000 PID number doesn't show up. I am on windows.kyttcar
You run it in your server. Not your local computer. :|nqngo
enter cltr+c to shutdown the serverNirupa

4 Answers

7
votes

run ps aux | grep rails then find the pid of the process. To kill it, run sudo kill -9 pid_number

1
votes

Find out the process id (PID) first:

$ lsof -wni tcp:8080

This will give you something like this:

$ lsof -wni tcp:8080 

COMMAND   PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
ruby    59656 rislam   14u  IPv6 0xa86b8563672ef037      0t0  TCP [::1]:http-alt (LISTEN)

Then, kill the process with PID = 59656 (for example, it will be different for you):

$ kill -9 59656

This should solve your problem.

You can also use the following command to kill all running apps that has rails in the name:

killall -9 rails

Sometimes, this is very effective when the first command does not do the trick.

credit: https://stackoverflow.com/a/33456222/5830835

1
votes
lsof -i tcp:3000

kill -9 PID

OR

Goto RAILS.root/tmp/pids/server.pid file and delete all content and save it.

0
votes

Enter Ctrl + C, that should shoutdown the server