英文:
Deploying a Go app with Imagemagick on Heroku
问题
我一直在尝试使用imagick部署一个简单的Go应用程序。
这需要安装Imagemagick
。我尝试使用multi buildpack来安装Imagemagick并运行我的应用程序。这是我的.buildpack
文件的内容:
https://github.com/mcollina/heroku-buildpack-imagemagick
https://github.com/kr/heroku-buildpack-go.git
这是我在Heroku上看到的错误信息:
正在获取仓库,完成。
正在计算对象:170,完成。
正在压缩对象:100%(154/154),完成。
正在写入对象:100%(169/169),170.13 KiB | 0 bytes/s,完成。
共计 169(增量 21),重用 0(增量 0)
-----> 正在获取自定义 git buildpack... 完成
-----> 检测到 Multipack 应用程序
=====> 正在下载 Buildpack:https://github.com/mcollina/heroku-buildpack-imagemagick
=====> 检测到框架:
-----> 正在安装 libpng 1.5.14
下载完成
安装完成
-----> 正在安装 imagemagick 6.8.2-3
下载完成
安装完成
-----> 为 imagemagick 构建运行时环境
=====> 正在下载 Buildpack:https://github.com/kr/heroku-buildpack-go.git
=====> 检测到框架:Go
-----> 正在安装 go1.3... 完成
-----> 正在运行:godep go install -tags heroku ./...
# github.com/gographics/imagick/imagick
错误:在此函数中首次使用未声明的标识符'RemoveAlphaChannel'
错误:在此函数中首次使用未声明的标识符'FlattenAlphaChannel'
godep: go 退出状态 2
! 推送被拒绝,无法编译 Multipack 应用程序
To git@heroku.com:philosoraptor-me.git
! [remote rejected] master -> master (pre-receive hook declined)
错误:无法推送一些引用至
英文:
I've been trying to deploy a simple Go app with imagick
This requires Imagemagick
. I've tried using the multi buildpack to install Imagemagick and run my app. This is how my .buildpack
looks like:
https://github.com/mcollina/heroku-buildpack-imagemagick
https://github.com/kr/heroku-buildpack-go.git
And this is the error I see on 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
答案1
得分: 1
我最终使用了Go语言优秀的标准库中的image
包,而不是依赖于imagemagick
。这也教会了我一个宝贵的教训,即在解决问题时尽可能寻找与问题最接近的解决方案,而不是试图用我最熟悉的工具来解决它。
英文:
I ended up using the image
package from Go's excellent standard lib instead of depending on imagemagick
.
This also taught me a valuable lesson about looking for a solution as close to the problem as possible than trying to solve it with a tool that I'm most familiar with.
答案2
得分: 0
你尝试过更新你本地的 gographics/imagick 副本并执行 godep update gographics/imagick
吗?错误 error: 'FlattenAlphaChannel' undeclared
似乎来自库而不是构建包。
英文:
Have you tried updating your local copy of gographics/imagick and doing godep update gographics/imagick
? The error error: 'FlattenAlphaChannel' undeclared
seems to be coming from the library and not the buildpack
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论