I think I need help to install the Rmagick gem in a RubyMine project

Apologies if this is a silly question but I have only recently started using RubyMine.
I have ImageMagick successfully installed using MacPorts and can Bundle Install Rmagick from the command line with no problem.
However, I am now building a project in RubyMine 3.2.4 (on OS X Lion).
When I try to bundle install the RMagick gem from RubyMine I get the messages below in the console.
ImageMagic is installed in /opt/local/lib/

Any help gratefully received!
Paul K.

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

        /Users/Paul_Krause/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in /Users/Paul_Krause/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/Paul_Krause/.rvm/gems/ruby-1.9.2-p290/bin:/Users/Paul_Krause/.rvm/gems/ruby-1.9.2-p290@global/bin:/Users/Paul_Krause/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin

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

Gem files will remain installed in /Users/Paul_Krause/.rvm/gems/ruby-1.9.2-p290/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/Paul_Krause/.rvm/gems/ruby-1.9.2-p290/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.

Process finished with exit code 5

Comment actions Permalink

Hello Paul,

it happens due to the way Mac OS X works with environment variables (such as Path). Please see http://devnet.jetbrains.net/docs/DOC-1160 on how to setup environment variables to be picked up by RubyMine

Comment actions Permalink

Many thanks Dennis!
I'm getting there, but I seem to be confused about copying across the paths to the Environment Variables Panel.
With PATH as key, and its value set to: /opt/local/bin:/opt/local/sbin:$PATH
I can find ImageMagick.
But RubyMine still needs the path to gcc.
If I try to add in
to the above value and save it, the Environment Variables Panel takes it out again.
Sorry for the silly question - I've so rarely needed to worry about these things.

Comment actions Permalink


Environment Variables preference pane doesn't understand variables substitution (like $PATH), you need to specify full value manually, like

Most likely that should fix the problem

Comment actions Permalink

Yes, that's me sorted! I should have looked at the ReadMe more carefully.
Thank you Dennis - if you're ever passing Guildford in the UK I owe you lunch :Z

Just a quick note should anyone else need to read this - there seems to be a little issue with Environment Variables preference pane if you edit an existing path. I could not get it to save the change (if I edited, clicked save, closed and reopened the pane then the value reverted to the original version). Deleting the entry and then adding a new entry with the full updated value did work, though.


Please sign in to leave a comment.