无法启动西纳特拉过程 - EventMachine的"无受体" [英] cannot start sinatra process - eventmachine "no acceptor"
问题描述
我有我作为后台进程运行,使用Apache端口转发端口80和7655.之间进行调解这在过去一直致力于罚款辛纳屈的应用程序。如今,没有那么好。我想不通为什么。
I have a Sinatra app that I run as a daemon, using Apache port-forwarding to mediate between port 80 and port 7655. This has been working fine in the past. Today, not so well. I cannot figure out why.
问题: sudo的红宝石my_process.rb
返回:
/var/lib/gems/1.9.1/gems/eventmachine-1.0.0/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
尝试:更新所有系统软件包,更新所有的宝石。没有帮助(除了从EventMachine的更明确的错误信息)。
Tried: updating all system packages, updating all gems. No help (except for the more clear error message from eventmachine).
当我运行须藤lsof的-i:7655
我什么也没有回来。当我运行须藤的ps aux
我不明白的任何的红宝石在所有进程。我觉得这极不规范,提供的错误消息的性质!
When I run sudo lsof -i :7655
I get nothing back. When I run sudo ps aux
I don't see any Ruby processes at all. Which I find highly irregular, given the nature of the error message!
那么,有什么我失踪在查明原因的端口不可用?
So is there something I'm missing in finding out why the port is unavailable?
还有:
试图改变港口,没有什么。我不知道它是与localhost的?当我平本地主机我得到的所有丢弃的数据包。这似乎不正常。
Tried changing ports, nothing. I wonder if it is related to "localhost"? When I ping localhost I get all dropped packets. That doesn't seem normal.
推荐答案
原来,这两条线在主西纳特拉脚本提供最多的信息:
Turns out these two lines in the main Sinatra script provided the most information:
set bind: "localhost"
set port: 7655
问题是与本地主机。 Loopback接口配置不正确。 使用ifconfig
显示罗
接口,但它没有被分配的IP 127.0.0.1
。要解决问题,跑在外壳下面的命令(在Ubuntu Linux系统上):
The problem was with localhost. The loopback interface was not properly configured. ifconfig
showed the lo
interface, but it hadn't been assigned the IP 127.0.0.1
. To resolve, ran the following commands in the shell (on an Ubuntu Linux system):
ifdown lo
ifup lo
这篇关于无法启动西纳特拉过程 - EventMachine的"无受体"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!