When deploying a Go project to Heroku, installation of the pq package fails. I've posted this in heroku buildpack github issues as well.
Error at deploy time:
-----> Running: godep go install -tags heroku ./...
gournay.go:10:3: cannot find package "github.com/lib/pq" in any of:
/app/tmp/cache/go1.2.1/go/src/pkg/github.com/lib/pq (from $GOROOT)
/tmp/build_ce268203-801e-4dfc-a56c-d70698d6c5bf/.heroku/g/src/github.com/andyatkinson/gournay/Godeps/_workspace/src/github.com/lib/pq (from $GOPATH)
/tmp/build_ce268203-801e-4dfc-a56c-d70698d6c5bf/.heroku/g/src/github.com/lib/pq
godep: go exit status 1
go get
and go install
run locally as expected. The project is built and running locally. I believe my package structure is correct, and GOPATH
and GOROOT
are correct. I am using godep
which creates the dependencies file below. The source for the pq package appears to be copied into the project, so it seems like it would compile from that source.
~/go/src/github.com/andyatkinson/gournay (master) $ cat Godeps/Godeps.json
{
"ImportPath": "github.com/andyatkinson/gournay",
"GoVersion": "go1.2.1",
"Deps": [
{
"ImportPath": "github.com/lib/pq",
"Rev": "c808a1bb644594ca717ac61f71e6b0e454b835e2"
}
]
}
Am I missing something? Anything else I should check? Thanks!
.godir
file which is not supposed to be necessary, and a few other things, but continued to get the Heroku deploy error. I tried out gopack on the project as a workaround/alternative to godep, and I was able to vendor the dependencies and successfully deploy to Heroku.