无法将简单的golang项目推送到heroku

My project "testheeroku7777" consist of two files. main.go:

package main

import "fmt"

func main() {

fmt.Println("Hello world!")

}

Procfile:

web: testheeroku7777

When I push:

testheeroku7777> git push heroku master

It gives an error:

Counting objects: 8, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 645.21 KiB | 5.92 MiB/s, done.
Total 8 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://codon-buildpacks.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 testheeroku7777.
remote: To https://git.heroku.com/testheeroku7777.git
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/testheeroku7777.git'

I've read provided links but I have no idea about this error.

doushi1996
doushi1996 如果我构建它并在本地运行该应用程序,那么它将起作用。转到构建heroku本地网络,可以显示[WARN]未找到ENV文件16:18:32web.1|你好,世界!16:18:32web.1成功退出
2 年多之前 回复

1个回答



Heroku在基本映像中未安装Go运行时,因此要求您使用转到buildpack 来构建您的应用。 但是,这还要求您使用诸如dep或govendor之类的供应商工具,这意味着该非常基本的应用程序本身无法使用。</ p>
</ div>

展开原文

原文

Heroku doesn't have the Go runtime installed in the base image, and therefore requires that you utilize the go buildpack to build your app. However, this also requires that you use a vendoring tool such as dep, or govendor, which means this very basic app, by itself, unfortunately won't work.

dpruwm6206
dpruwm6206 我有完全相同的问题,您解决了吗?
一年多之前 回复
duaj39673
duaj39673 如果使用我支持govendor的支持的工具不同,那么会有很多支持。 我实际上不确定为什么会有一个严格的供应商要求,但是我的猜测是它以合理的方式解决了GOPATH问题,而不会强迫您创建src / lib / / bin目录结构(模仿GOPATH的结构) 期望)。
2 年多之前 回复
dongshubang7816
dongshubang7816 我试图指定构建包heroku create testheeroku7777 -b https://github.com/heroku/heroku-buildpack-go.git但推给出相同的错误。 为什么需要使用供应商工具,该怎么办?
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问