【问题标题】:Deploying go webapps to heroku: can't find package issue将 go webapps 部署到 heroku:找不到包问题
【发布时间】:2017-08-21 04:26:24
【问题描述】:

我正在关注 this tutorial 并尝试将一个简单的 Go web 应用程序部署到 Heroku,但在解决错误时遇到了困难:

remote: -----> Running: godep go install -tags heroku ./... remote: main.go:7:3: cannot find package "github.com/russross/blackfriday" in any of: remote: /app/tmp/cache/go1.3.3/go/src/pkg/github.com/russross/blackfriday (from $GOROOT) remote: /tmp/build_1a204a91c152b49fe234bde14529ad27/.heroku/g/src/bitbucket.gotest/Godeps/_workspace/src/github.com/russross/blackfriday (from $GOPATH) remote: /tmp/build_1a204a91c152b49fe234bde14529ad27/.heroku/g/src/github.com/russross/blackfriday remote: godep: go exit status 1 remote: remote: ! Push rejected, failed to compile Go app

我是 Go 新手,所以我假设我搞砸了我的包结构,但运行 $GOPATH/bin/godep go installgo install 工作正常。

这是我的 go 目录的(缩写)结构:

    • 测试应用
    • main.go
    • github.com -codegangsta
    • 俄罗斯
    • 黑色星期五

谢谢。

【问题讨论】:

标签: heroku go


【解决方案1】:

通过将我的 $GOPATH/bin 目录添加到我的路径来解决问题。

export PATH=$PATH:$GOPATH/bin

很好奇为什么这是必要的。

【讨论】:

  • 请修正错字:"$GOAPTH/bin"
猜你喜欢
  • 2021-01-15
  • 2013-02-08
  • 2021-11-16
  • 2011-06-10
  • 2020-01-06
  • 1970-01-01
  • 2012-05-19
  • 1970-01-01
相关资源
最近更新 更多