0
votes

I have installed about 40 other gems but this one can't install due to this error:

Installing rmagick (2.13.1) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/durrantm/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 

checking for Ruby version >= 1.8.5... yes checking for /usr/bin/gcc-4.2... yes checking for Magick-config... no Can't install RMagick 2.13.1. Can't find Magick-config in /Users/durrantm/.rvm/gems/[email protected]_Abroad101/bin:/Users/durrantm/.rvm/gems/ruby-1.9.2-p290@global/bin:/Users/durrantm/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/durrantm/.rvm/bin:/Library/PostgreSQL/9.1/bin:/usr/local/bin:/Library/PostreSQL/9.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/sbin:/usr/local/mysql/bin:/Users/durrantm/.rvm/bin

* 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/durrantm/.rvm/rubies/ruby-1.9.2-p290/bin/ruby

Gem files will remain installed in /Users/durrantm/.rvm/gems/[email protected]_Abroad101/gems/rmagick-2.13.1 for inspection. Results logged to /Users/durrantm/.rvm/gems/[email protected]_Abroad101/gems/rmagick-2.13.1/ext/RMagick/gem_make.out An error occured while installing rmagick (2.13.1), and Bundler cannot continue. Make sure that gem install rmagick -v '2.13.1' succeeds before bundling.

I tried this link https://github.com/maddox/magick-installer but it errored out at the end with:
/usr/bin/install -c -m 644 ./builds/unix/freetype2.pc \ /usr/local/lib/pkgconfig/freetype2.pc tar: Unrecognized archive format tar: Error exit delayed from previous errors.

Right now I am trying Veraticus' solution, then I will try Peters if necessary.

4
I'm also getting this "Unrecognized archive format" error when RVM tries to install rubygems on Mountain Lion. I'm going to see if installing gnu tar helps.thekingoftruth

4 Answers

6
votes

What I found here perfectly works on Ubuntu:

sudo apt-get install libxml2-dev libxslt1-dev imagemagick libmagickwand-dev

and then,

bundle install

as usual.

HTH

3
votes

Installing rmagick is always a pain...

If you're having trouble, I'd step back and use Homebrew to reinstall Imagemagick. (This can usually be accomplished with brew install imagemagick.) Make sure to follow any follow-up instructions homebrew gives you, and then try installing the gem once again.

0
votes

I resolved the same issue by following these steps:

  1. Downgrade image-magics from 7 to 6 by running brew install imagemagick@6.
  2. then run PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick.
-1
votes

Be sure, you installed ImageMagick. If you have it, try to reinstall with that script