Cannot install gems with native extension on Lion even with Developer Tools installed

Jason Brennan's Avatar

Jason Brennan

02 Oct, 2011 04:24 PM

I've got a clean install of Lion and I'm trying to install some gems which need native extensions.

sudo gem install rmagick


Building native extensions. This could take a while...
ERROR: Error installing rmagick:

ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb

mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

It looks as though the ruby.h file has moved but I don't know how to fix this problem.

I'm running the latest version of rubygems.

  1. Support Staff 1 Posted by Nick Quaranto on 12 Oct, 2011 02:26 PM

    Nick Quaranto's Avatar

    Yikes, not sure about this one :(

    Can you try to install a newer Ruby with RVM instead?


    rvm install 1.9.2 rvm use 1.9.2 gem install rmagick

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac