Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kill localhost:3000 process from Windows command line

So im using ruby on rails in windows (i hear you all spitting your coffee onto the screen), its only a short term thing. (using ubuntu at home) So i tried to fire up webrick this afternoon and i get the error message

TCPServer Error, only one usage of each socket address is normally permitted

So it seems as if port 3000 is still running from last week? My question is how do i kill the process from the Windows command line. normally i have to press ctrl and pause/break in windows as ctrl c is not working which is only killing the batch process it seems..

Any solutions welcomed

Edit

So it seems as if

tasklist 

will give me the list of processes, but where do i find the process for running the webrick server?

ruby.exe is not listed as a running process

like image 365
Richlewis Avatar asked Dec 03 '12 14:12

Richlewis


People also ask

How do I stop a process from command line?

A. A. Usually to stop a process, you start task manager, select the Processes tab, select the process and click "End Process" however you can also accomplish the same from the command prompt using 2 Resource Kit utilities.


1 Answers

Try using netstat -a -o -n to determine the pid of the process running on port 3000. Then you should be able to use taskkill /pid #### to kill whatever process is running on that port.

Probably not the most graceful way to do it, but I think it should work.

EDIT

You'll probably have to also use the /F flag to force-kill the process. I just tried it on my local machine, and that worked fine.

like image 184
Zajn Avatar answered Oct 02 '22 01:10

Zajn