Ant*_*ony 8 python heroku python-2.7 windows-8 heroku-toolbelt
我正在尝试从这个Python Heroku教程中运行hello.py.运行此命令后我的问题开始了:.即使我安装了Heroku Toolbelt,我也收到以下错误:foreman start
工头不被视为内部或外部命令,可操作程序或批处理文件
所以我将foreman文件(版本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>
Run Code Online (Sandbox Code Playgroud)
hello.py
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World'
Run Code Online (Sandbox Code Playgroud)
Procfile
web: gunicorn hello:app
Run Code Online (Sandbox Code Playgroud)
编辑1
看完这个答案后,我做了以下几点:
gem uninstall foreman
gem install foreman -v 0.61.0
Run Code Online (Sandbox Code Playgroud)
但是,当我重申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>
Run Code Online (Sandbox Code Playgroud)
任何帮助将非常感谢.提前致谢.
我通过运行以下命令解决了这个问题:
gem uninstall foreman
gem install foreman -v 0.61.0 [EDIT]
Run Code Online (Sandbox Code Playgroud)
如前所述这里.
| 归档时间: |
|
| 查看次数: |
3014 次 |
| 最近记录: |