我已经尝试使用云端9中的这篇文章来杀死我的rails服务器。
我使用gem thin
,每次尝试运行云服务器命令时都会收到此错误
rails s -b $IP -p $PORT
=> Booting Thin
=> Rails 4.2.6 application starting in development on http://0.0.0.0:8080
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on 0.0.0.0:8080, CTRL+C to stop
Exiting
/usr/local/rvm/gems/ruby-2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:530:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
from /usr/local/rvm/gems/ruby-2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:530:in `start_server'
from /usr/local/rvm/gems/ruby-2.3.0/gems/thin-1.6.4/lib/thin/backends/tcp_server.rb:16:in `connect'
from /usr/local/rvm/gems/ruby-2.3.0/gems/thin-
答案 0 :(得分:0)
此错误表示,8080端口已在使用中,您可能需要为您的应用程序使用不同的端口
<强>更新强>:
尝试杀死现有进程。使用此命令ps -ef | grep thin
查找端口号,然后将其终止kill -9 <port>
。立即尝试运行您的应用。
答案 1 :(得分:0)
似乎端口8080正在使用中,使用端口查找PID,运行:
netstat -tulpn | grep :8080
然后你可以kill -9 <PID>