【问题标题】:Heroku cannot detect default language(python-3.6.4) even runtime.txt exists即使存在 runtime.txt,Heroku 也无法检测到默认语言(python-3.6.4)
【发布时间】:2018-07-13 14:04:16
【问题描述】:

我尝试上传应用并在 heroku 上运行 源文件如下。 https://github.com/utahub/django_attend-managing-app/tree/heroku_check

用命令

git push heroku heroku_check:master

但即使认为根目录中存在 runtime.txt,Heroku 也不会检测到默认语言。

remote: Compressing source files... done.
remote: Building source:
remote:
remote:  !     No default language could be detected for this app.
remote:                         HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote:                         See https://devcenter.heroku.com/articles/buildpacks
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to uta-attend-managing-app.
remote:

这个问题我用了 2 天。 请告诉我为什么会这样。

提前谢谢你。

【问题讨论】:

  • 注意:使用 buildpack 命令,它成功了,但是在没有 buildpack 命令的情况下是否可以部署?没有使用 buildpack 的 qiita 文章,所以我认为我的应用程序看起来有问题。我想弄清楚我

标签: python django heroku


【解决方案1】:

已经有人问过这个问题:Can't push to the heroku

CodeWizard 的解决方案:

阅读此文档,它将向您解释该怎么做。
https://devcenter.heroku.com/articles/buildpacks

在应用程序上设置构建包

您可以通过设置 buildpack 值来更改应用程序使用的 buildpack。
下次推送应用时,将使用新的 buildpack。

$ heroku buildpacks:set heroku/python

构建包集。 random-app-1234 的下一个版本将使用 heroku/php。
运行 git push heroku master 以使用此 buildpack 创建新版本。

这就是它不适合你的原因,因为你没有设置它。

...下次推送应用时,将使用新的 buildpack。

You may also specify a buildpack during app creation:

$ heroku create myapp --buildpack heroku/python

【讨论】:

    【解决方案2】:

    解决了。

    我只是弄错了文件 nem

    错误:requirement.txt 正确:requirements.txt

    改正后,它起作用了。

    【讨论】:

      猜你喜欢
      • 2017-10-29
      • 2017-02-13
      • 2020-12-22
      • 2018-02-22
      • 1970-01-01
      • 2021-11-12
      • 1970-01-01
      • 2018-11-22
      相关资源
      最近更新 更多