Heroku Foreman错误在0.0.0.0:5000

ren*_*box 4 django heroku heroku-toolbelt

我正在尝试使用Heroku的Foreman应用调试此问题.我的问题是Foreman正在尝试在端口5000和ip地址0.0.0.0上运行该进程.它说使用端口有一些东西,但我不知道如何弄清楚,因为我没有其他运行.我试过运行'netstat -lnt | grep 5000'什么都没有.

> foreman start
11:16:45 web.1  | started with pid 17758
11:16:46 web.1  | 2013-12-31 11:16:46 [17758] [INFO] Starting gunicorn 18.0
11:16:46 web.1  | 2013-12-31 11:16:46 [17758] [ERROR] Connection in use: ('0.0.0.0', 5000)
11:16:46 web.1  | 2013-12-31 11:16:46 [17758] [ERROR] Retrying in 1 second.
11:16:47 web.1  | 2013-12-31 11:16:47 [17758] [ERROR] Connection in use: ('0.0.0.0', 5000)
11:16:47 web.1  | 2013-12-31 11:16:47 [17758] [ERROR] Retrying in 1 second.
Run Code Online (Sandbox Code Playgroud)

我通过它自己运行gunicorn命令并且它工作正常(所以我能够将其作为一个问题消除):

> gunicorn hellodjango.wsgi
2013-12-31 11:25:33 [17853] [INFO] Starting gunicorn 18.0
2013-12-31 11:25:33 [17853] [INFO] Listening at: http://127.0.0.1:8000 (17853)
2013-12-31 11:25:33 [17853] [INFO] Using worker: sync
2013-12-31 11:25:33 [17856] [INFO] Booting worker with pid: 17856
Run Code Online (Sandbox Code Playgroud)

我在我的Mac上运行它(10.8).

任何有关如何解决这个问题的见解将不胜感激.

-rb


经过进一步调查,我发现Apple的网络发现应用程序Bonjour使用了0.0.0.0:5000.看看如何为Foreman改变端口.

ren*_*box 12

想出这一切.

解决方法是手动设置env中的端口并以这种方式运行foreman.

export PORT=5001
Run Code Online (Sandbox Code Playgroud)

然后

> foreman start
13:22:23 web.1  | started with pid 18194
13:22:24 web.1  | 2013-12-31 13:22:24 [18194] [INFO] Starting gunicorn 18.0
13:22:24 web.1  | 2013-12-31 13:22:24 [18194] [INFO] Listening at: http://0.0.0.0:5001 (18194)
13:22:24 web.1  | 2013-12-31 13:22:24 [18194] [INFO] Using worker: sync
13:22:24 web.1  | 2013-12-31 13:22:24 [18197] [INFO] Booting worker with pid: 18197
Run Code Online (Sandbox Code Playgroud)

我想这对于OSX上的每个人来说都是一个问题,希望这会省去一些麻烦.

-rb