3

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

kyttcar
  • 189
  • 4
  • 12
  • 2
    favorite this http://stackoverflow.com/a/4473322/1301840 – lusketeer Jun 28 '16 at 23:14
  • When I run lsof -wni tcp:3000 PID number doesn't show up. I am on windows. – kyttcar Jun 28 '16 at 23:37
  • You run it in your server. Not your local computer. :| – nqngo Jun 28 '16 at 23:46
  • enter cltr+c to shutdown the server – Nirupa Jun 28 '16 at 23:51
  • try this https://docs.c9.io/docs/process-list – Artem Ankudovich Jun 29 '16 at 15:53
  • Thanks AAkudovich. It's a great resource what you posted. I should definitely get acquainted more with cloud9. The app is running on a Puma. It's running fine. My main question became what the difference between a puma server and a WEBrick server. My understanding is that WEBrick is the default server . I wonder in which cases it goes into puma. – kyttcar Jun 29 '16 at 21:55

4 Answers4

7

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

Ronan Lopes
  • 3,320
  • 4
  • 25
  • 51
1

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

Community
  • 1
  • 1
Timmy Von Heiss
  • 2,160
  • 17
  • 39
1
lsof -i tcp:3000

kill -9 PID

OR

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

puneet18
  • 4,341
  • 2
  • 21
  • 27
0

Enter Ctrl + C, that should shoutdown the server