dougan5772 2018-02-17 13:07
浏览 83

无法将简单的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.

  • 写回答

1条回答

  • dtip91401 2018-02-17 19:56
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试