我阅读了之前关于它的所有帖子,但仍然无法纠正它。我在Heroku创建的计算机目录中添加了requirements.txt和Procfile。 Procfile读取“web:python Chat Server.py”。还将runtime.txt添加到读取“python-3.6.2”的同一目录中。但是,它在命令提示符中再次给出相同的错误。我怎么解决这个问题?这是整个错误消息:
“C:\ Users \ asus \ chat_server> git push heroku master计数对象:6,完成。使用最多4个线程进行增量压缩。压缩对象:100%(4/4),完成。写入对象:100%(6 / 6),1.14 KiB | 585.00 KiB / s,完成。总计6(增量1),重用0(delta 0)远程:压缩源文件...完成。远程:构建源:远程:远程:----- >应用程序与buildpack不兼容:https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz remote:更多信息:https://devcenter.heroku.com/articles/buildpacks#detection-failure remote:remote:!推送失败的远程:验证部署...远程:远程:!推送拒绝到沸腾流-15219。远程:到https://git.heroku.com/boiling-stream-15219.git![远程拒绝] master - > master(pre-receive hook拒绝)错误:未能将某些引用推送到'https://git.heroku.com/boiling-stream-15219.git'“
读这篇文章的人:你需要两个文件:
第一个文件:requirements.txt
包含类似:gunicorn==19.7.1
或pip freeze > requirements.txt
的结果。
第二个文件:Procfile
包含类似:web: gunicorn app:app
或可能是空白的。请注意,此示例中的app:app
是对python文件名的引用。这意味着每次声明web
进程,并且启动此类型的dyno时,也运行命令gunicorn app:app
以启动您的Web服务器。
然后git add .
和git commit -m "added Procfile and requirements.txt"
。
然后运行git push heroku master
从你当地的master
分支推到heroku
遥控器。
除了JaredH的答案之外,在运行git push heroku master
之前,请确保您当前的分支是主人。