从 Windows 命令行中杀死 localhost:3000 进程 [英] Kill localhost:3000 process from Windows command line

查看:34
本文介绍了从 Windows 命令行中杀死 localhost:3000 进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在窗户的导轨上使用 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 并在 Windows 中暂停/中断,因为 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 确定端口上运行的进程的pid3000.那么你应该可以使用 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.

编辑

您可能还必须使用 /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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆