将golang代码推送到heroku时,出现“与buildpack不兼容的应用程序”

时间:2019-06-07 01:56:58

标签: go heroku

将用golang编写的代码推送到heroku时,会发生以下错误。是否有问题?

转到1.12版

  • go.mod
module myapp

go 1.12

require (
    github.com/Bowery/prompt v0.0.0-20190419144237-972d0ceb96f5 // indirect
    github.com/dgrijalva/jwt-go v0.0.0-20180921172315-3af4c746e1c2
    github.com/go-sql-driver/mysql v1.4.1
...
)
  • Procfile
web: bin/myapp

以下命令已执行

heroku buildpacks:set heroku/go
go build -o bin/myapp -v .
git commit
  • 错误消息
[xxx@MacBook-Air-8 myapp][28_deploy_to_heroku]$ git push heroku master
Counting objects: 240, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (217/217), done.
Writing objects: 100% (240/240), 72.73 KiB | 709.00 KiB/s, done.
Total 240 (delta 98), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/go.tgz
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to myapp.
remote: 
To https://git.heroku.com/myapp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'

请让我知道是否缺少任何信息。

0 个答案:

没有答案