在Heroku上部署Revel应用程序

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

Deploy revel application on Heroku

问题

我正在尝试在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'

有任何想法我需要做什么吗?谢谢。

英文:

I am trying to deploy an application in heroku. I am using the revel framework, but (I don't know if it can be a problem) I wasn't using the framework before... but yesterday I move my code into the framework. The web application works locally, but it can't be deployed in heroku.

This is the output when I try "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'

Any idea what I need to do??
Thank you.

答案1

得分: 1

你可以按照@thwd的建议,在本地构建一个slug,但如果你还没有为linux/amd64构建过,这可能有点棘手。(我自己从未尝试过这样做)

另一个选择是使用构建包。revel的官方构建包在这里:https://github.com/robfig/heroku-buildpack-go-revel,但我认为它已经过时了——你应该fork它并根据自己的需求进行修复。(这是我的版本

英文:

You can build a slug locally, as suggested by @thwd, but this may be a bit tricky if you aren't already building for linux/amd64. (I've never done this myself)

Another option is to use a build pack. The official build pack for revel is here: https://github.com/robfig/heroku-buildpack-go-revel but I think it's out of date -- you should fork it and fix it up to your needs. (here's my version)

huangapple
  • 本文由 发表于 2016年10月27日 17:26:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/40280909.html
匿名

发表评论

匿名网友

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

确定