我正在尝试将 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 构建包
gem 'carrierwave' gem 'rmagick',需要:'RMagick' gem 'fog'
使用的宝石版本:
carrierwave (1.2.1)
rmagick (2.13.2)