Rails and OS X: How to install rmagick?
rmagick has a problem working with imagemagick (>= 6.8.0-10) from homebrew.
You can either
update rmagick
gem by
bundle update rmagick
or manually symbol link some dylib to make it work:
$ cd "`Magick-config --prefix`lib" $ ln -s libMagick++-Q16.7.dylib libMagick++.dylib $ ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib $ ln -s libMagickWand-Q16.7.dylib libMagickWand.dylib
After that gem install rmagick
should work.
Check the discussion about this in homebrew/issues/16625
Update:Thanks @faraz for the nice one-liner command:
cd "`Magick-config --prefix`/lib"; ln -s libMagick++-Q8.7.dylib libMagick++.dylib; ln -s libMagickCore-Q8.7.dylib libMagickCore.dylib; ln -s libMagickWand-Q8.7.dylib libMagickWand.dylib
Mac OSX Sierra & Rails 5
brew unlink imagemagickbrew install imagemagick@6brew link imagemagick@6 --force
I had the same problem.
If you check the mkmf.log, you'll see the following error message:
ld: library not found for -lgompclang: error: linker command failed with exit code 1 (use -v to see invocation)checked program was:/* begin */1: #include "ruby.h"2: 3: int main() {return 0;}/* end */\
Here is how I solved it:
Uninstall current version of ImageMagick:
brew uninstall imagemagick
Reinstall imagemagick without openmp support (this is the library responsible for lgomp):
brew install imagemagick --disable-openmp
Install rmagick:
gem install rmagick
Thats it!