在Heroku安装Rmagick gem时出现错误

3

我正在尝试将Rails 4应用程序部署到Heroku,但安装Rmackick gem失败。尝试了buildpacks,但没有运气。

出现了以下错误:

remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        
remote:        current directory:
remote:        /tmp/build_16e2e594c459dbc294186d524bfe933a/vendor/bundle/ruby/2.3.0/gems/rmagick-2.13.2/ext/RMagick
remote:        /tmp/build_16e2e594c459dbc294186d524bfe933a/vendor/ruby-2.3.0/bin/ruby -r
remote:        ./siteconf20171214-20333-dbtx1i.rb extconf.rb
remote:        checking for Ruby version >= 1.8.5... yes
remote:        checking for gcc... yes
remote:        checking for Magick-config... no
remote:        Can't install RMagick 2.13.2. Can't find Magick-config in
remote:        vendor/bundle/bin:vendor/bundle/ruby/2.3.0/bin:vendor/ruby-2.3.0/bin:/tmp/tmp.kJfUDQAIbQ/bin/:/usr/local/bin:/usr/bin:/bin:/tmp/codon/vendor/bin:bin:/usr/local/bin:/usr/bin:/bin
remote:        
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:        
remote:        Provided configuration options:
remote:        --with-opt-dir
remote:        --without-opt-dir
remote:        --with-opt-include
remote:        --without-opt-include=${opt-dir}/include
remote:        --with-opt-lib
remote:        --without-opt-lib=${opt-dir}/lib
remote:        --with-make-prog
remote:        --without-make-prog
remote:        --srcdir=.
remote:        --curdir
remote:        --ruby=/tmp/build_16e2e594c459dbc294186d524bfe933a/vendor/ruby-2.3.0/bin/$(RUBY_BASE_NAME)

尝试过:

如何在Heroku上使用最新版本的Imagemagick?

https://github.com/ello/heroku-buildpack-imagemagick

https://github.com/thoughtbot/paperclip/wiki/Upgrade-Imagemagick-On-Heroku

  • heroku/ruby buildpack

gem 'carrierwave' gem 'rmagick', require: 'RMagick' gem 'fog'

使用的gem版本:

carrierwave (1.2.1)
rmagick (2.13.2)
1个回答

4

更新 rmagick 版本解决了问题,看起来 2.13.2 与 Heroku 平台不兼容。2.16.0 版本可以正常工作。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接