无法将示例GOLang应用程序部署到Heroku [英] Cannot deploy sample GOLang application to Heroku
问题描述
我尝试将示例GO应用程序部署到此处
I tried deploying the sample GO application to Heroku listed here
但是当我运行命令时:
git push heroku master
git push heroku master
我收到以下错误:
计数对象:完成28个.
Counting objects: 28, done.
压缩对象:已完成100%(21/21).书写对象:100%(28/28),3.08 KiB,已完成.总计28个(增量6),已重用0个(增量0)
Compressing objects: 100% (21/21), done. Writing objects: 100% (28/28), 3.08 KiB, done. Total 28 (delta 6), reused 0 (delta 0)
!Heroku推送被拒绝,未检测到Cedar支持的应用程序
! Heroku push rejected, no Cedar-supported app detected
至git@heroku.com:mysterious-refuge-1227.git![远程拒绝]主机->主机(接收前挂钩被拒绝)错误:推送失败一些参考'git@heroku.com:mysterious-refuge-1227.git'
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'
示例代码可能已过期,因此我创建了一个简单的hello world GO App,但是从相同的git push命令中,出现以下错误:
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?
这是我的系统信息:
- GoLang版本:go版本go1.1 linux/386
- Kubuntu版本:12.10
推荐答案
我怀疑您的原始错误是因为您使用 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.
这篇关于无法将示例GOLang应用程序部署到Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!