gpt4 book ai didi

python - 错误的文件描述符 - Heroku Foreman

转载 作者:太空狗 更新时间:2023-10-29 21:03:36 26 4
gpt4 key购买 nike

我正在尝试从 this Python Heroku tutorial 运行 hello.py .运行此命令后我的问题开始了:foreman start。即使我安装了 Heroku Toolbelt,我仍然收到以下错误:

foreman is not recognized as an internal or external command, operable program or batch file

所以我将工头文件(版本 0.63.0)的位置添加到我的路径:

C:\Program Files (x86)\Heroku\ruby-1.9.2\bin

并重新启动命令提示符并重新运行 foreman start。现在,我收到此错误:

Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

C:\Users\me\Desktop\Code\heroku_python_app>venv\Scripts\activate
(venv) C:\Users\me\Desktop\Code\heroku_python_app>foreman start
Bad file descriptor
C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.63.0
/lib/foreman/engine.rb:372:in `read_nonblock'
C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.63.0
/lib/foreman/engine.rb:372:in `block (2 levels) in watch_for_output'
C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.63.0
/lib/foreman/engine.rb:368:in `loop'
C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.63.0
/lib/foreman/engine.rb:368:in `block in watch_for_output'
12:57:38 web.1 | exited with code 1
12:57:38 system | sending SIGKILL to all processes

(venv) C:\Users\me\Desktop\Code\heroku_python_app>

你好.py

import os
from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
return 'Hello World'

个人资料

web: gunicorn hello:app

编辑 1

看完this answer ,我做了以下事情:

gem uninstall foreman   
gem install foreman -v 0.61.0

但是,当我重新运行 foreman start 时,我现在遇到了这个错误

(venv) C:\Users\me\Desktop\Code\heroku_python_app>foreman start
14:13:20 web.1 | started with pid 252
14:13:20 web.1 | exited with code 1
14:13:20 system | sending SIGKILL to all processes
14:13:20 | Traceback (most recent call last):
14:13:20 | File "C:\Users\me\Desktop\Code\heroku_python_app\venv\Scri
pts\gunicorn-script.py", line 9, in <module>

(venv) C:\Users\me\Desktop\Code\heroku_python_app>

我们将不胜感激任何帮助。提前致谢。

最佳答案

我通过运行以下命令解决了这个问题:

gem uninstall foreman
gem install foreman -v 0.61.0 [EDIT]

如前所述here .

关于python - 错误的文件描述符 - Heroku Foreman,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17051890/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com