After upgrading to Mountain Lion, I got this message when trying to run my local rails server:
Installing rmagick (2.13.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
Users/user/.rvm/rubies/ruby-1.9.3-rc1/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... no
No C compiler found in ${ENV['PATH']}. See mkmf.log for details.
*** 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
--without-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/user/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby
Gem files will remain installed in /Users/user/.rvm/gems/ruby-1.9.3-rc1@some_gemset/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-1.9.3-rc1@some_gemset/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.
Here is what I did:
Download or update your XCode 4.4 from the AppStore. If you have any previous XCode versions in you Developer
folder, just delete them.
In XCode's Preferences > Downloads you can install command line tools.
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Download Quartz 2.7.2+, then install it
You will need to fix the symlink it makes:
ln -s /opt/X11 /usr/X11
brew install imagemagick
sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
cd your_app && bundle install
Point 6 should be changed to
as sudo su && whatever doesn't work.