我阅读了之前关于它的所有帖子,但仍然无法纠正它 . 我在由Heroku创建的计算机目录中添加了requirements.txt和Procfile . Procfile读取“web:python Chat Server.py” . 还在读取“python-3.6.2”的同一目录中添加了runtime.txt . 但是,它在命令提示符中再次给出了相同的错误 . 我怎么解决这个问题?这是整个错误消息:
“C:\ Users \ asus \ chat_server> git push heroku master计数对象:6,完成 . 使用最多4个线程进行Delta压缩 . 压缩对象: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'“
1 回答
读这篇文章的人:你需要两个文件:
第一个文件:
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