Error installing prawn-gmagick within Heroku stack 20 due to invalid wand/magick_wand.h path

218 Views Asked by At

Here is the error I'm getting when trying to deploy to Heroku using the most recent stack (20)

   Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
   
   current directory:
   /tmp/build_20bfe735/vendor/bundle/ruby/2.6.0/gems/prawn-gmagick-0.0.9/ext/image
   /tmp/build_20bfe735/vendor/ruby-2.6.6/bin/ruby -I
   /tmp/build_20bfe735/vendor/ruby-2.6.6/lib/ruby/2.6.0 -r
   ./siteconf20210328-11397-1gaqmyj.rb extconf.rb
   creating Makefile
   
   current directory:
   /tmp/build_20bfe735/vendor/bundle/ruby/2.6.0/gems/prawn-gmagick-0.0.9/ext/image
   make "DESTDIR=" clean
   
   current directory:
   /tmp/build_20bfe735/vendor/bundle/ruby/2.6.0/gems/prawn-gmagick-0.0.9/ext/image
   make "DESTDIR="
   compiling image.c
   image.c:3:10: fatal error: wand/magick_wand.h: No such file or directory
       3 | #include <wand/magick_wand.h>
         |          ^~~~~~~~~~~~~~~~~~~~
   compilation terminated.
   make: *** [Makefile:245: image.o] Error 1
   
   make failed, exit code 2

Same error after I tried this buildpack with graphicsmagick https://elements.heroku.com/buildpacks/bogini/heroku-buildpack-graphicsmagick

So, after playing a bit I made it work by adding 3 additional dependencies to the Aptfile in the example above

libgraphicsmagick++3
libgraphicsmagick++1-dev
libgraphicsmagick-q16-3

So the final Aptfile looks like this

debhelper
g++
gsfonts
libbz2-dev
libexif-dev
libfreetype6-dev
libice-dev
libjbig-dev
libjpeg-dev
liblcms2-dev
libltdl-dev
libpng-dev
libsm-dev
libtiff-dev
libwebp-dev
libwmf-dev
libx11-dev
libxext-dev
libxml2-dev
perl
sharutils
transfig
x11proto-core-dev
zlib1g-dev
libgraphicsmagick++3
libgraphicsmagick++1-dev
libgraphicsmagick-q16-3

And my buildpacks setup:

1. https://github.com/heroku/heroku-buildpack-apt
2. https://github.com/bogini/heroku-buildpack-graphicsmagick
3. heroku/ruby

Do you guys see any problem with any of those dependencies and setup?

0

There are 0 best solutions below