Ruby Gems Installation Troubleshoting

RMagick

brew install imagemagick

find /usr -name MagickWand.h

Then I encounter this:

2 warnings generated.
linking shared-object RMagick2.bundle
ld: file not found: /usr/local/lib/libltdl.7.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [RMagick2.bundle] Error 1

The solution is something like this:

cd /usr/local/Cellar/imagemagick/6.8.0-10/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
gem install rmagick

It works for me

nokogiri

Problem:

libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.

Solution:

Install libiconv first, using brew

Then do sth like this:

gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.13.1

Share this article