Deployment 无法将示例GOLang应用程序部署到Heroku

Deployment 无法将示例GOLang应用程序部署到Heroku,deployment,heroku,go,Deployment,Heroku,Go,我尝试将示例GO应用程序部署到Heroku 但当我运行命令时: git推送heroku主机 我得到以下错误: 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

我尝试将示例GO应用程序部署到Heroku

但当我运行命令时:

git推送heroku主机

我得到以下错误:

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 git@heroku.com:evening-reef-1503.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:evening-reef-1503.git'
计数对象:28,完成

压缩对象:100%(21/21),完成。书写对象:100% (28/28),3.08千磅,完成。总计28(增量6),重复使用0(增量0)

!!Heroku推送被拒绝,未检测到支持Cedar的应用程序

到git@heroku.com:神秘避难所1227.git![远程拒绝] 主控->主控(拒绝预接收挂钩)错误:推送失败 一些参考文献git@heroku.com:神秘避难所-1227.吉特'

示例代码可能已过时,因此我创建了一个简单的hello world GO应用程序,但使用相同的git push命令,我得到了以下错误:

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 git@heroku.com:evening-reef-1503.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:evening-reef-1503.git'
关于我如何解决这个问题有什么想法吗

这是我的系统信息:

  • GoLang版本:go版本go1.1 linux/386
  • Kubuntu版本:12.10

我怀疑您最初的错误是因为您使用heroku create创建了应用程序。您使用的是Go,它通过构建包得到支持,因此您应该使用类似于heroku create-b的东西来创建应用程序https://github.com/kr/heroku-buildpack-go.git。我相信演示应用程序也犯了同样的错误-修复了它-我也提交了一个拉取请求。

我假设您在推送之前没有将
Procfile
添加到您的repo中。github中的示例代码有一个Procfile。在我自己的应用程序中,我包含了一个proc文件。我已经确认它已添加到我的回购协议中。您也可以在事后运行
heroku config:set BUILDPACK\u URL来执行此操作=https://github.com/kr/heroku-buildpack-go
。我在Heroku上部署Golang应用程序时仍然遇到问题?我可以找个人。我已经很好地配置了我的
Procfile
,并且我已经将buildpack添加到Heroku中(我可以在vars中看到它)。但是,当我执行
heroku日志时,我看到:bash:juicr:command未找到,这意味着
Procfile
命令不正确。可能值得注意的是,我正在使用Travis部署,但这不会有什么区别。如何命名项目?通常,您需要:heroku创建projectName。这里我们得到一个随机的名字。ex:stormy lowlands xxxxOk找到它:heroku create-b projectName