7

(Edit: see bottom for solution) I am making a Ruby On Rails project and am trying to install the RMagick gem. Using OS X 10.6, Ruby version 2.0.0p247, Rails 4.0.0, RVM 1.22.12.

When I run a bundle install I get the following error:

...
Installing rmagick (2.13.2) 
Errno::EACCES: Permission denied - /Users/jasonpather/.rvm/gems/ruby-2.0.0-p247/g
ems/rmagick-2.13.2/build_tarball.rake
An error occurred while installing rmagick (2.13.2), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling.

So then I try the suggestion:

Jason-Pathers-MacBook-Pro:BuyABrick jasonpather$ gem install rmagick -v '2.13.2'
ERROR:  While executing gem ... (Errno::EACCES)
Permission denied - /Users/jasonpather/.rvm/gems/ruby-2.0.0-p247/gems/rmagick
-2.13.2/build_tarball.rake

So then I try sudo:

Jason-Pathers-MacBook-Pro:BuyABrick jasonpather$ sudo gem install rmagick -v '2.1
3.2'
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

/Users/jasonpather/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc-4.2... yes
checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in /Users/jasonpather/.rvm
/gems/ruby-2.0.0-p247/bin:/Users/jasonpather/.rvm/gems/ruby-2.0.0-p247@global/bin
:/Users/jasonpather/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/jasonpather/.rvm/gems/
ruby-2.0.0-p247/bin:/Users/jasonpather/.rvm/gems/ruby-2.0.0-p247@global/bin:/User
s/jasonpather/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/jasonpather/.rvm/bin:/opt/lo
cal/bin:/opt/local/sbin:/opt/local/lib/postgresql83/bin/:/usr/local/bin:/usr/bin:
/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/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/jasonpather/.rvm/rubies/ruby-2.0.0-p247/bin/ruby


Gem files will remain installed in /Users/jasonpather/.rvm/gems/ruby-2.0.0-p247/g
ems/rmagick-2.13.2 for inspection.
Results logged to /Users/jasonpather/.rvm/gems/ruby-2.0.0-p247/gems/rmagick-2.13.
2/ext/RMagick/gem_make.out

I would very much appreciate any help. I've looked at similar questions on this site but none of the suggestions have helped. Do I need to install other packages before I install RMagick or something?

Edit: solution

I simply used homebrew to install imagemagick brew install imagemagick then sudo gem install rmagick and now bundle install runs fine!

Jason Pather
  • 1,127
  • 2
  • 12
  • 18
  • The suggestions in this question doesn't work? http://stackoverflow.com/q/3704919/1004046 – Pigueiras Sep 26 '13 at 08:56
  • 1
    Install `ImageMagic` first. Howto: http://www.imagemagick.org/script/binary-releases.php#macosx – Yevgeniy Anfilofyev Sep 26 '13 at 09:00
  • @YevgeniyAnfilofyev I'm trying that now and I followed the instructions on that page, but when I try to run `convert logo: logo.gif` it tells me "Illegal Instruction" and `bundle install` throws the same error. Will the method you linked work with Snow Leopard 10.6 even though it says Mountain Lion in the description? EDIT: according to [this](http://stackoverflow.com/questions/2503172/imagemagick-on-mac-osx-snow-leopard-is-there-any-way-to-get-it-to-compile-and-r) the binary is Lion-only :( – Jason Pather Sep 26 '13 at 09:11
  • `Illegal instruction` could mean you execute wrong binary file. Did you install it from `port` or by dowloading binary? I'm now off of my OS X, so when I come to home I'll check installation of ImageMagic on OS X 10.6 – Yevgeniy Anfilofyev Sep 26 '13 at 09:21
  • @YevgeniyAnfilofyev I gave up on that binary because I think it's Lion only. I used Homebrew to install imagemagick and it seems to have worked. Thanks for the help! – Jason Pather Sep 26 '13 at 09:50

1 Answers1

8

You need to install Image Magick (checking for Magick-config... no from your log suggests that).

The easiest way to do that (since you are on mac) is with Homebrew. Install Homebrew (follow any instructions it gives you during install — they aren't many) and then just run:

brew install imagemagick

Then run bundle install again.

Ruslan
  • 1,208
  • 3
  • 17
  • 28
  • Yup you're right I tried it and success was the result! I then used `sudo gem install rmagick` and then `bundle install` worked! – Jason Pather Sep 26 '13 at 09:49