我阅读了之前所有关于它的帖子,但仍然无法纠正它。我在Heroku创建的计算机目录中添加了requirements.txt和Procfile。Procfile读取“web:python聊天服务器.py”。还将runtime.txt添加到读取“python-3.6.2”的同一目录中。但是,它在命令提示符中再次给出相同的错误。我怎样才能解决这个问题?这是完整的错误消息:
“C:\Users\asus\chat\u server>;git push heroku master 计数对象:6,完成。 增量压缩最多使用4个线程。 压缩对象:100%(4/4),完成。 书写对象:100%(6/6),1.14kib | 585.00kib/s,完成。 总计6(增量1),重复使用0(增量0) 远程:压缩源文件…完成。 远程:建筑源: 远程: 远程:---->;应用程序与buildpack不兼容:https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz 远程:更多信息:https://devcenter.heroku.com/articles/buildpacks#detection-failure 远程: 远程:!推送失败 远程:正在验证部署。。。 远程: 远程:!拒绝推送到BOOTH-stream-15219。 远程: 至https://git.heroku.com/boiling-stream-15219.git ![remote rejected]master->;master(拒绝预接收挂钩) 错误:无法将某些引用推送到“https://git.heroku.com/boiling-stream-15219.git”
除了JaredH的答案之外,在运行
git push heroku master
之前,确保当前分支是主分支阅读本文的任何人:您将需要两个文件:
第一个文件:
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
远程相关问题 更多 >
编程相关推荐