简体   繁体   English

如何终止正在使用的端口— eventmachine

[英]how do I kill a port in use — eventmachine

I get the following error: 我收到以下错误:

eventmachine.rb:534:in `start_tcp_server': no acceptor (port is in use or requires root privileges)

I'm not sure what the process or port is and want to kill it so I can run my script again. 我不确定进程或端口是什么,想杀死它,以便再次运行脚本。

How do I do that? 我怎么做?

ps ax | grep ruby
kill -9 [pid]

Example: 例:

ps ax | grep ruby
#=> 857 pts/19     Sl+    0:04 /home/andreydeineko/.rvm/rubies/ruby-2.2.3/bin/ruby bin/rails server
#=> 14639 pts/18   S+     0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn rails
#=> 25368 pts/17   Sl+    0:02 /home/andreydeineko/.rvm/rubies/ruby-2.2.3/bin/ruby bin/rails c
kill -9 857
ps ax | grep ruby
#=> 14639 pts/18   S+     0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn rails
#=> 25368 pts/17   Sl+    0:02 /home/andreydeineko/.rvm/rubies/ruby-2.2.3/bin/ruby bin/rails c

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM