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

我一直在尝试使用imagick部署一个简单的 Go 应用程序 这需要Imagemagick. 我已经尝试使用多 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


达令说
浏览 175回答 2
2回答

梦里花落0921

我最终使用了imageGo 优秀标准库中的包,而不是依赖于imagemagick.这也教会了我一个宝贵的教训,那就是寻找尽可能接近问题的解决方案,而不是尝试使用我最熟悉的工具来解决它。

守候你守候我

您是否尝试过更新 gographics/imagick 的本地副本并执行操作godep update gographics/imagick?错误error: 'FlattenAlphaChannel' undeclared似乎来自库而不是构建包
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Go