1

In the past I used RMagick and also had Imagemagick, and recently I bundle installed a newer version of RMagick.

When restarting my rails server I got errors. So I decided to uninstall first imagemagick (from brew) and then uninstall rmagick.

I tried re-installing rmagick and I am some trouble (first one being I can't install from the bundle command). I tried gem install rmagick -v '2.13.1' but I get the following permission error:

ERROR:  While executing gem ... (Errno::EACCES)
Permission denied - /Users/username/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper

I also tried with the sudo and got

ERROR:  While executing gem ... (Errno::EACCES)
Permission denied - /Users/username/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper
usercomputer:~ Username$ sudo gem install rmagick -v '2.13.1'
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

    /Users/username/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
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/username/.rvm/gems/ruby-1.9.3-p194/bin:/Users/Aurelien/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/username/.rvm/rubies/ruby-1.9.3-p194/bin:/Applications/MAMP/bin/php5/bin:/Applications/MAMP/htdocs/cake/cake/cake/console:/Users/username/.rvm/gems/ruby-1.9.3-p194/bin:/Users/username/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/username/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/username/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/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/username/.rvm/rubies/ruby-1.9.3-p194/bin/ruby


Gem files will remain installed in /Users/username/.rvm/gems/ruby-1.9.3-p194/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/username/.rvm/gems/ruby-1.9.3-p194/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

Surely I have done something wrong along the way, but I am not sure what?

Thank you for you answers.

Zedrian
  • 909
  • 9
  • 29
  • I guess the rmagick doesnot support the latest imagemagick AFAIK last test on my machine the Rmagick was working successfully with imagemagick version 6.7.0 – Viren Jan 16 '13 at 10:10
  • Maybe it's just missing some path like described [here](http://stackoverflow.com/questions/9050419/cant-install-rmagick-2-13-1-cant-find-magickwand-h) – thorsten müller Jan 16 '13 at 10:14
  • This looks like you don't have permission to access the right directories. Did you install imagemagick as root or something? Maybe you can try `gem pristine rmagick` - that solved an issue for me where RMagick was built against the wrong version of imagemagick after an upgrade - but in your case I'd bet on imagemagick being installed by root. – Tigraine Jan 16 '13 at 10:42
  • Sorry Tigraine, what is root? – Zedrian Jan 16 '13 at 11:24
  • I had to update brew, and then re-installed imagemagick. Apparently there is a problem between the new imagemagick from homebrew and RMagick. I tried the `gem pristine rmagick` but I don't have rmagick installed anymore so it doesn't work. I also tried [link](http://stackoverflow.com/questions/13963404/rails-and-os-x-how-to-install-rmagick/13963950#13963950) but I get the same permission error when trying to install RMagick – Zedrian Jan 16 '13 at 11:47
  • I am not sure why it suddenly start working, but after following these steps [link](http://stackoverflow.com/questions/13963404/rails-and-os-x-how-to-install-rmagick/13963950#13963950), then went to my rails project and instead ran the `sudo gem install rmagick`. Now I got it to work! – Zedrian Jan 16 '13 at 12:18

1 Answers1

2

It seems the latest version of ImageMagick is not compatible with RMagick. I solved the issue by following this:

http://blog.paulopoiati.com/2013/01/28/installing-rmagick-in-mac-os-x-mountain-lion-with-homebrew/

Chandresh Pant
  • 1,173
  • 15
  • 19