pantry icon indicating copy to clipboard operation
pantry copied to clipboard

Cannot install gem `rmagick` with +ruby and +imagemagick.org

Open philipgiuliani opened this issue 2 years ago • 2 comments

pkgx [email protected] +imagemagick.org -- gem install rmagick
checking for brew... no
checking for pacman... no
checking for Ruby version >= 2.3.0... yes
checking for outdated ImageMagick version (<= 6.7.7)... no
checking for clang... yes
checking for __GNUC__... yes
checking for MagickCore/MagickCore.h... no
checking for magick/MagickCore.h... no


ERROR: Can't install RMagick 5.3.0. Can't find magick/MagickCore.h.

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

I can confirm that the file ~/.pkgx/imagemagick.org/v7.1.1.12/include/ImageMagick-7/MagickCore/MagickCore.h exists.

philipgiuliani avatar Nov 11 '23 09:11 philipgiuliani

saw you on irc, so yeah it appears that image magick has an additional namespace in its headers. I can fix in the pantry. One mo.

mxcl avatar Nov 11 '23 14:11 mxcl

Thanks to the help of @mxcl, I was now able to install the gem rmagick. I still had to change --disable-shared to --enable-shared in the pantry in order to work, otherwise I got this crash:

rmimage.c:7552:32: error: use of undeclared identifier 'IsGrayImage'
    return has_attribute(self, IsGrayImage);

Now I am very close, the only problem that remains is that it seems to try installing gems into /usr/local/lib which needs sudo permission.

pkgx [email protected] +imagemagick.org +mysql.com -- bundle --verbose

Bundler::PermissionError: There was an error while trying to write to /usr/local/lib/ruby/gems/3.2.0/cache. It is likely that you need to grant write permissions for that path.

philipgiuliani avatar Nov 12 '23 08:11 philipgiuliani