在Heroku上部署revel应用程序

时间:2016-10-27 09:26:20

标签: git heroku go revel

我正在尝试在heroku中部署应用程序。我正在使用revel框架,但是(我不知道它是否可能是一个问题)我之前没有使用该框架...但昨天我将我的代码移动到框架中。 Web应用程序在本地工作,但无法在heroku中部署。

这是我尝试“git push heroku master”时的输出

Counting objects: 46, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (41/41), done.
Writing objects: 100% (46/46), 135.45 KiB | 0 bytes/s, done.
Total 46 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Go app detected
remote: -----> Checking Godeps/Godeps.json file.
remote: -----> Using go1.6.3
remote:  !!    Installing package '.' (default)
remote:  !!    
remote:  !!    
remote: -----> Running: godep go install -v -tags heroku .
remote: can't load package: package ndc-console: no buildable Go source files in /tmp/tmp.XI5m2PPe7K/.go/src/ndc-console
remote: godep: go exit status 1
remote:  !     Push rejected, failed to compile Go app.
remote: 
remote:  !     Push failed
remote: Verifying deploy....
remote: 
remote: !   Push rejected to ndc-console.
remote: 
To https://git.heroku.com/ndc-console.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ndc-console.git'

知道我需要做什么吗? 谢谢。

1 个答案:

答案 0 :(得分:1)

根据@thwd的建议你可以build a slug locally,但如果你还没有为linux / amd64构建,这可能有点棘手。 (我自己从未这样做过)

另一种选择是使用build pack。狂欢的官方构建包在这里:https://github.com/robfig/heroku-buildpack-go-revel但我觉得它已经过时了 - 你应该把它分叉并根据你的需要进行修复。 (这里是my version