在使用buildpack在Heroku上部署Go Revel应用程序时出现错误。

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

Errors deploying Go Revel app on Heroku using buildpack

问题

我正在尝试在Heroku上使用Go和Revel,使用的是这个构建包 https://github.com/robfig/heroku-buildpack-go-revel,但似乎不起作用:

我在尝试使用基本的Revel HelloWorld示例时遇到了错误。

$ go get github.com/robfig/helloworld
$ cd $GOPATH/src/github.com/robfig/helloworld
$ echo "github.com/robfig/helloworld" > .godir
$ git add .godir
$ git commit -a -m ".godir"
$ heroku create -b https://github.com/robfig/heroku-buildpack-go-revel.git
$ git push heroku master

计算对象: 34, 完成。
使用最多8个线程进行增量压缩。
压缩对象: 100% (23/23), 完成。
写入对象: 100% (34/34), 57.41 KiB | 0 bytes/s, 完成。
共计 34 (增量 1), 重用 0 (增量 0)

-----> 正在获取自定义的git构建包... 完成
-----> 检测到Revel应用程序
-----> 安装 Go 1.1.2... 完成
       安装 Virtualenv... 完成
       安装 Mercurial... 完成
       安装 Bazaar... 完成
-----> 正在运行: go get -tags heroku ./...
mv: 无法获取“/tmp/build_86bd3433-7925-4ae9-b4bf-f5466525aef1/.go/bin/*'”:没有那个文件或目录

 !     推送被拒绝,无法编译 Revel 应用程序

To git@heroku.com:peaceful-hamlet-6152.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:peaceful-hamlet-6152.git'
英文:

I'm trying to use Go and Revel on Heroku using this buildpack https://github.com/robfig/heroku-buildpack-go-revel but it doesn't seem to work:

I'm getting an error trying to use the basic revel helloworld example.

$ go get github.com/robfig/helloworld
$ cd $GOPATH/src/github.com/robfig/helloworld
$ echo "github.com/robfig/helloworld" > .godir
$ git add .godir
$ git commit -a -m ".godir"
$  heroku create -b https://github.com/robfig/heroku-buildpack-go-revel.git
$ git push heroku master

Counting objects: 34, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (34/34), 57.41 KiB | 0 bytes/s, done.
Total 34 (delta 1), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> Revel app detected
-----> Installing Go 1.1.2... done
       Installing Virtualenv... done
       Installing Mercurial... done
       Installing Bazaar... done
-----> Running: go get -tags heroku ./...
mv: cannot stat `/tmp/build_86bd3433-7925-4ae9-b4bf-f5466525aef1/.go/bin/*': No such file or directory

 !     Push rejected, failed to compile Revel app

To git@heroku.com:peaceful-hamlet-6152.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:peaceful-hamlet-6152.git'

答案1

得分: 3

我fork了heroku-buildpack-go-revel,并成功修复了移动不存在目录的错误(我将其更改为有条件地移动)。修复后的buildpack链接如下:

然后,我成功将一个helloworld revel应用部署到了Heroku上:

export GOPATH=$HOME/go
mkdir $GOPATH
go get github.com/dougnukem/revel-helloworld
cd $GOPATH/src/github.com/dougnukem/revel-helloworld
heroku create
heroku config:set BUILDPACK_URL=https://github.com/dougnukem/heroku-buildpack-go-revel.git
git push heroku master
heroku open

我提交了一个修复的pull request:

英文:

I forked the heroku-buildpack-go-revel and was able to fix the error that was moving the non-existent directory (I changed it to conditionally move it).

Fixed buildpack:

I was then able to deploy a helloworld revel app to heroku:

export GOPATH=$HOME/go
mkdir $GOPATH
go get github.com/dougnukem/revel-helloworld
cd $GOPATH/src/github.com/dougnukem/revel-helloworld
heroku create
heroku config:set BUILDPACK_URL=https://github.com/dougnukem/heroku-buildpack-go-revel.git
git push heroku master
heroku open

I submitted a pull request with that fix:

huangapple
  • 本文由 发表于 2013年10月13日 06:23:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/19339826.html
匿名

发表评论

匿名网友

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

确定