LoginSignup
6
5

More than 3 years have passed since last update.

HerokuにPythonアプリをデプロイしたときにハマった箇所

Posted at

runtime.txtを用意してから、ローカルからのPushも、GitHub連携でのデプロイでも失敗しました。
ググっても解決せず、よくよく見たらruntime.txtの記述が間違っていたという話。

>git push heroku master
Enumerating objects: 27, done.
Counting objects: 100% (24/24), done.
Delta compression using up to 8 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (13/13), 4.72 KiB | 1.18 MiB/s, done.
Total 13 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote:  !     Requested runtime (Python-3.7.4) is not available for this stack (heroku-18).
remote:  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to hogehoge.
remote:
To https://git.heroku.com/hogehoge.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/hogehoge.git'

runtime.txtのPythonPが大文字になっているのが原因でした。

runtime.txt
python-3.7.4

のように小文字にしてあげたら、無事デプロイに成功しました。

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5