从Windows命令行中杀死localhost:3000进程 [英] Kill localhost:3000 process from Windows command line
问题描述
所以我在窗户的轨道上使用ruby(我听说你都吐了你的咖啡在屏幕上),它只是一个短期的东西。 (使用ubuntu在家)所以我试图启动webrick今天下午,我得到错误消息
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
所以看起来端口3000从上周仍然运行?我的问题是如何从Windows命令行终止进程。通常我必须按ctrl和暂停/中断在窗口中ctrl c不工作,这只是杀了批处理它似乎..
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..
任何解决方案欢迎
所以似乎
tasklist
会给我的进程列表,运行webrick服务器的过程
will give me the list of processes, but where do i find the process for running the webrick server?
ruby.exe
未列为正在运行的进程
ruby.exe
is not listed as a running process
推荐答案
尝试使用 netstat -a -o -n
确定 pid
在端口3000上运行的进程。然后,您应该能够使用 taskkill / pid ####
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
您可能还需要使用 / F
强制杀死进程。我只是尝试了在我的本地机器,这工作正常。
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.
这篇关于从Windows命令行中杀死localhost:3000进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!