我正在尝试从hello.py运行本Python Heroku教程。我的问题是在运行以下命令:foreman start之后开始的。即使我安装了Heroku工具带,我还是得到了以下错误
foreman不被识别为内部或外部命令、可操作的程序或批处理文件。
因此,我将领班文件(版本0.63.0)的位置添加到我的路径中。
C:\程序文件(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>hello.py
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World'Procfile
web: gunicorn hello:app编辑1
在阅读了这个答案之后,我做了以下工作:
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>任何帮助都将是非常感谢的。提前谢谢。
发布于 2013-11-23 18:17:08
https://stackoverflow.com/questions/17051890
复制相似问题