As background, I have extensive knowledge of software build systems, Unix (I'm using Debian 11 in this instance) and Python environments, but almost no knowledge of modern Ruby environments.
I'm wanting to write a post in a friend's blog built with Jekyll and so am trying to get his blog building in development mode on my system. I'm wanting to minimise the amount of Ruby stuff I bring in using system packages, so I'm using bundle install --path vendor/bundle to set up the project dependencies, which include the rmagick gem.
I've installed the libmagickcore-6.q16-dev package, which gives me /usr/include/ImageMagick-6/wand/MagickWand.h. However, bundler is unable to install the RMagick 2.16.0 gem.
Looking in vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/rmagick-2.16.0/mkmf.log, this seems to be the failure:
have_header: checking for wand/MagickWand.h... -------------------- no
"x86_64-linux-gnu-gcc -E -I/usr/include/x86_64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. conftest.c -o conftest.i"
conftest.c:3:10: fatal error: wand/MagickWand.h: No such file or directory
3 | #include <wand/MagickWand.h>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
Without doing extensive further investigation, I'm guessing that this is due to the include path being incorrect. This kind of hints at the RMagick gem being broken, since pkg-config does supply this:
$ pkg-config --cflags MagickCore
-fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6
I'm not able to upgrade the Gems that he's using, nor even easily test that any changes I might make on my system work on the systems he's using. So to work around this I'd like to get bundle to add -I /usr/include/ImageMagick-6 (or do the moral equivalent).
What's the best way to make this happen? I don't see a bundle command line option for this. Perhaps there's an environment variable I can set?