在Heroku上使用Imagemagick部署Go应用程序

时间:2014-10-15 11:55:43

标签: heroku go imagemagick

我一直在尝试使用imagick部署一个简单的Go应用 这需要Imagemagick。我已尝试使用multi buildpack安装Imagemagick并运行我的应用。这就是我.buildpack的样子:

https://github.com/mcollina/heroku-buildpack-imagemagick
https://github.com/kr/heroku-buildpack-go.git

这是我在Heroku上看到的错误:

    Fetching repository, done.
Counting objects: 170, done.
Compressing objects: 100% (154/154), done.
Writing objects: 100% (169/169), 170.13 KiB | 0 bytes/s, done.
Total 169 (delta 21), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/mcollina/heroku-buildpack-imagemagick
=====> Detected Framework:
-----> Installing libpng 1.5.14
       Download completed
       Installation completed
-----> Installing imagemagick 6.8.2-3
       Download completed
       Installation completed
-----> Building runtime environment for imagemagick
=====> Downloading Buildpack: https://github.com/kr/heroku-buildpack-go.git
=====> Detected Framework: Go
-----> Installing go1.3... done
-----> Running: godep go install -tags heroku ./...
# github.com/gographics/imagick/imagick
error: 'RemoveAlphaChannel' undeclared (first use in this function)
error: 'FlattenAlphaChannel' undeclared (first use in this function)
godep: go exit status 2

 !     Push rejected, failed to compile Multipack app

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

2 个答案:

答案 0 :(得分:1)

我最终使用了Go优秀标准库中的image包,而不是依赖于imagemagick

这也让我学到了一个有价值的教训,即尽可能接近问题寻找解决方案,而不是尝试用我最熟悉的工具解决问题。

答案 1 :(得分:0)

您是否尝试过更新本地gographics / imagick副本并执行godep update gographics/imagick?错误error: 'FlattenAlphaChannel' undeclared似乎来自库而不是buildpack