0

I am trying to install the rmagick gem. When I run "gem install rmagick" it gives me the following error:

In file included from rmagick.c:13:
./rmagick.h:1210:51: error: unknown type name 'MagickPixelPacket'
extern void   Color_to_MagickPixelPacket(Image *, MagickPixelPacket *, VALUE);

followed by a few similar complaints about missing methods and incorrect parameters(I can post the rest if they seem helpful).

To me, this seems like a version problem, which makes sense because I had ImageMagick 6 installed as well as version 7, so I uninstalled version 6 but the problem persists.

I also had to symlink the following for rmagick to find the required .h files, in case that's significant:

ln -s /usr/local/include/ImageMagick-7/MagickCore /usr/local/include/magick  
ln -s /usr/local/include/ImageMagick-7/MagickWand /usr/local/include/wand 

I'm on a Macbook, installing things with brew. My current ImageMagick version is 7, but I'm suspicious of some leftover version 6 things causing problems.

Any thoughts? I'm happy to give more information if necessary, but I can't think of anything else at the moment.

Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
Patrick
  • 530
  • 5
  • 9
  • Not an exact answer, but at our shop we've completely replaced Rmagick with [MiniMagick](https://github.com/minimagick/minimagick), mostly because RMagick is such a pita to install. IDK if it will install any better in your current situation, but it may be an option. – Brad Werth Mar 01 '17 at 17:32

2 Answers2

1

Each distribution manages the Ruby gems it's own way, ex :
Debian requires the installation of libmagickwand-dev for this gem

What you whant to look for is see if the gem requires additionnal dependencies or not on Mac ( had similar problems with bundle on Debian )

1

Thanks to Brad and Matthieu for your suggestions! MiniMagick does seem like a good solution, and Matthieu is definitely right about there being different dependencies from system to system; in my case I ended up giving up on trying to use ImageMagick 7 with RMagick, but I did get it to work with ImageMagick 6. Here's what worked for me:

brew remove imagemagick
PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig
brew install imagemagick@6
gem install rmagick

Many thanks to this SE post: https://stackoverflow.com/a/41788501/5054505 For the record, I am on OSX Yosemite

Also, see this RMagick issue: https://github.com/rmagick/rmagick/issues/256. Hopefully this will be fixed soon, but for now it seems like reverting to version 6 is the popular approach.

Community
  • 1
  • 1
Patrick
  • 530
  • 5
  • 9