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

huangapple go评论140阅读模式
英文:

Cannot deploy sample GOLang application to Heroku

问题

我尝试将示例GO应用程序部署到Heroku上,链接在这里

但是当我运行以下命令时:

> git push heroku master

我收到以下错误:

计算对象:28,完成。
> 压缩对象:100%(21/21),完成。写入对象:100%
>(28/28),3.08 KiB,完成。总共28个(delta 6),重用0个(delta 0)
>
> ! Heroku推送被拒绝,未检测到支持Cedar的应用程序
>
> 到git@heroku.com:mysterious-refuge-1227.git ![远程拒绝]
> master -> master(预接收挂钩拒绝)错误:无法推送
> 一些引用到'git@heroku.com:mysterious-refuge-1227.git'

示例代码可能已过时,所以我创建了一个简单的Hello World GO应用程序,但是从相同的git push命令中,我得到了以下错误:

计算对象:10,完成。
压缩对象:100%(8/8),完成。
写入对象:100%(10/10),1.16 MiB | 690 KiB/s,完成。
总共10个(delta 1),重用0个(delta 0)

-----> 获取自定义git构建包...完成
-----> 检测到Go应用程序
-----> 安装Go 1.1...完成
       安装Virtualenv...完成
       安装Mercurial...完成
       安装Bazaar...完成
-----> 运行:go get -tags heroku ./...
包echo/...:无法识别的导入路径“echo/...”
 !     Heroku推送被拒绝,无法编译Go应用程序

到git@heroku.com:evening-reef-1503.git
 ![远程拒绝] master -> master(预接收挂钩拒绝)
错误:无法推送一些引用到'git@heroku.com:evening-reef-1503.git'

有关如何解决此问题的任何想法吗?

这是我的系统信息:

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

  • Kubuntu版本:12.10

英文:

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 git@heroku.com:mysterious-refuge-1227.git ! [remote rejected]
> master -> master (pre-receive hook declined) error: failed to push
> some refs to 'git@heroku.com: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 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'

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

答案1

得分: 12

我怀疑你最初的错误是因为你使用了heroku create创建了应用程序。你正在使用Go语言,它是通过一个构建包支持的,所以你应该使用类似heroku create -b https://github.com/kr/heroku-buildpack-go.git的方式创建应用程序。我相信演示应用程序也犯了同样的错误 - 我的分支修复了这个问题 - 我也提交了一个拉取请求。

英文:

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.

huangapple
  • 本文由 发表于 2013年5月20日 12:44:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/16642753.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定