将Go项目部署到Heroku时,pq软件包的安装失败。我已经在 heroku buildpack github问题中发布
When deploying a Go project to Heroku, installation of the pq package fails. I've posted this in heroku buildpack github issues as well.
部署时出错:
-----> Running: godep go install -tags heroku ./... gournay.go:10:3: cannot find package "github/lib/pq" in any of: /app/tmp/cache/go1.2.1/go/src/pkg/github/lib/pq (from $GOROOT) /tmp/build_ce268203-801e-4dfc-a56c-d70698d6c5bf/.heroku/g/src/github/andyatkinson/gournay/Godeps/_workspace/src/github/lib/pq (from $GOPATH) /tmp/build_ce268203-801e-4dfc-a56c-d70698d6c5bf/.heroku/g/src/github/lib/pq godep: go exit status 1去获得和 go install 按预期在本地运行。该项目是在本地建立和运行的。我相信我的包裹结构是正确的,而 GOPATH 和 GOROOT 是正确的。我正在使用下面创建依赖项文件的 godep pq包的源代码似乎被复制到项目中,所以似乎是从该源编译。
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/andyatkinson/gournay (master) $ cat Godeps/Godeps.json { "ImportPath": "github/andyatkinson/gournay", "GoVersion": "go1.2.1", "Deps": [ { "ImportPath": "github/lib/pq", "Rev": "c808a1bb644594ca717ac61f71e6b0e454b835e2" } ] }?还有什么我应该检查的?谢谢!
Am I missing something? Anything else I should check? Thanks!
推荐答案在开发中运行 godep save
从godep README:
from godep README:
$ godep save This will save a list of dependencies to the file Godeps/Godeps.json, and copy their source code into Godeps/_workspace. Read over its contents and make sure it looks reasonable. Then commit the file to version control.---更新---
我看到你的回购,并在英雄 warm-depths-3154.herokuapp/ ,按照步骤
I see your repo, and up on heroku warm-depths-3154.herokuapp/, follow the steps
rm -Rf gopack.config .godir .gopack godep save git add --all . // please commit the Godep folder git commit -m 'using godep, removed gopack'(提交 github/dukex/gournay/commit/0de2390835357879a34ea452a56eeeb6391e5ba8 )
更多推荐
在Heroku的第三方包项目
发布评论