4

I am trying to install the locomotive gem into my rails app. It has a dependency to use rmagick gem 2.12.2

I successfully installed the latest version of rmagic 2.13.2 but apparently the older version that the gem requires has some sort of path issue with my installation of imagemagick witch is version 6.8.0-10

I've read a number of posts all saying to set different environment paths re-installing imagemagic using brew and bla bla bla. The main problem is with rmagic version and it's dependancy on the location and version of imagemagick

The current errors I get from the gem install are the following.

    ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

        /Users/mwallace/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
extconf.rb:107: Use RbConfig instead of obsolete and deprecated Config.
checking for clang... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.3.5... yes
checking for HDRI disabled version of ImageMagick... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... yes
checking for InitializeMagick() in -lMagickCore... no
checking for InitializeMagick() in -lMagick... no
Can't install RMagick 2.12.2. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.

*** 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.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/mwallace/.rvm/rubies/ruby-1.9.3-p362/bin/ruby
    --with-MagickCorelib
    --without-MagickCorelib
    --with-Magicklib
    --without-Magicklib
mattwallace
  • 4,132
  • 6
  • 43
  • 77

1 Answers1

1

I just ran into this myself. The problem is that rmagick 2.12.2 is incompatible with ImageMagick 6.8 or higher. From the changelog for rmagick 2.13.2:

RMagick 2.13.2
    o Fixed issues preventing RMagick from working with version 6.8 or higher
    o Fixed issues preventing RMagick from working with ruby 1.9.3 

If you have to have that old version of rmagick, then you have to downgrade ImageMagick. In my case, I only had four lines of code doing some simple image resizing and format conversion, so I switched from rmagick to image_magick. It also uses the ImageMagick library so it has the same capabilities, but it's a pure ruby wrapper around the library, so it appears to work with anything between ImageMagick 6.4 and 6.8, and probably a bigger range of versions than that. The API is very similar to rmagick, but not identical.

sockmonk
  • 4,195
  • 24
  • 40