Cannot install gems with native extension on Lion even with Developer Tools installed
I've got a clean install of Lion and I'm trying to install some gems which need native extensions.
sudo gem install rmagick
Fails:
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.
Support Staff 2 Posted by Nick Quaranto on 12 Oct, 2011 02:26 PM
Yikes, not sure about this one :(
Can you try to install a newer Ruby with RVM instead?
https://rvm.beginrescueend.com/rvm/install/
Then
rvm install 1.9.2rvm use 1.9.2gem install rmagick