Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot deploy sample GOLang application to Heroku

I tried deploying the sample GO application to Heroku listed here

But when I run the command:

git push heroku master

I get the following error:

Counting objects: 28, done.

Compressing objects: 100% (21/21), done. Writing objects: 100% (28/28), 3.08 KiB, done. Total 28 (delta 6), reused 0 (delta 0)

! Heroku push rejected, no Cedar-supported app detected

To [email protected]:mysterious-refuge-1227.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '[email protected]:mysterious-refuge-1227.git'

The sample code might be out-of-date so I created a simple hello world GO App but from the same git push command I got the following error:

Counting objects: 10, done.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (10/10), 1.16 MiB | 690 KiB/s, done.
Total 10 (delta 1), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> Go app detected
-----> Installing Go 1.1... done
       Installing Virtualenv... done
       Installing Mercurial... done
       Installing Bazaar... done
-----> Running: go get -tags heroku ./...
package echo/...: unrecognized import path "echo/..."
 !     Heroku push rejected, failed to compile Go app

To [email protected]:evening-reef-1503.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:evening-reef-1503.git'

Any ideas on how I can resolve this issue?

Here is my system info:

  • GoLang version: go version go1.1 linux/386
  • Kubuntu version: 12.10
like image 602
rexposadas Avatar asked May 20 '13 04:05

rexposadas


People also ask

Does heroku support Golang?

Heroku recognizes an app as being written in Go by the existence of a go. mod file in the root directory. Heroku also supports govendor, godep & GB, but this tutorial focuses only on Go modules. The go.

How do I deploy Golang web app?

Creating a golang web application, using go modules and the gin web framework to serve strings, JSON, and static files. Using a multistage Dockerfile to create a lightweight Docker image. Deploying a Docker-based application to Heroku using heroku stack:set container and a heroku. yml file.


1 Answers

I suspect your original error is because you created the application with heroku create. You're using Go, which is supported through a buildpack, so you should create the application with something like heroku create -b https://github.com/kr/heroku-buildpack-go.git. I believe the demo app makes the same mistake - my fork fixes it - and I've submitted a pull request too.

like image 123
Jon Mountjoy Avatar answered Oct 08 '22 12:10

Jon Mountjoy