ruby-on-railsrubyosx-lionrakermagick

Rails + Mac OS X: libMagickCore-Q16.7.dylib doesn't work


If I run some kind of rake command, I get this error message:

rake aborted!
dlopen(/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libfreetype.6.dylib
  Referenced from: /usr/local/lib/libMagickCore-Q16.7.dylib
  Reason: Incompatible library version: libMagickCore-Q16.7.dylib requires version 16.0.0 or later, but libfreetype.6.dylib provides version 13.0.0 - /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle
...

I am running on RoR 3.2, OSX Lion.

Could anyone help me, please, how to fix this issue? I spent 2 days of googling, reading discussions, but unfortunately with zero success...

Thank you so much!


Solution

  • I have an amazing how-to-install-rmagick that have been working beautifully for me, try to re-install ImageMagick following these steps:

    1. yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel -y (I use CentOS, you can translate the commands to your distro)
    2. Download ImageMagick. Write wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz and press Enter. ImageMagick.tar.gz is created in the current directory.
    3. Unpack the ImageMagick archive. Write tar xczf ImageMagick.tar.gz and press Enter. A new directory, ImageMagick-version, where version is the ImageMagick version number, is created.
    4. Switch to the ImageMagick directory. Write cd ImageMagick-version and press Enter.
    5. Configure the ImageMagick build. Write ./configure --prefix=/usr/local --without-perl and press Enter.
    6. Compile ImageMagick. Write make and press Enter. ImageMagick compiles. This step may take several minutes.
    7. Install ImageMagick to your home directory. Write make install and press Enter.
    8. Remove the installation files. Write rm -r ImageMagick.tar.gz and press Enter.
    9. Add /usr/local/bin to your PATH.
      • Write echo export PATH="/usr/local/bin:$PATH" >> ~/.bash_profile and press Enter.
      • Reload your .bash_profile. Write source ~/.bash_profile and press Enter.
    10. Install the RMagick gem.
      • Write export LD_LIBRARY_PATH=/usr/local/lib and press Enter.
      • Write export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ and press Enter.
      • Install the RMagick gem in your Ruby on Rails application.

    Tell me later how it goes.