Skip to content

Instantly share code, notes, and snippets.

@juandazapata
Created July 26, 2012 15:07
Show Gist options
  • Save juandazapata/3182604 to your computer and use it in GitHub Desktop.
Save juandazapata/3182604 to your computer and use it in GitHub Desktop.
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

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:

1) Install XCode 4.4 into /Applications

Download or update your XCode 4.4 from the AppStore. If you have any previous XCode versions in you Developer folder, just delete them.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

3) Let Everyone Know Where XCode Is

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

4) Install X11

Download Quartz 2.7.2+, then install it

You will need to fix the symlink it makes:

ln -s /opt/X11 /usr/X11

5) Reinstall your imagemagick

brew install imagemagick

6) Symlink gcc

sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2

7) Bundle

cd your_app && bundle install
@UnConundrum
Copy link

I have a brand new iMac and none of this worked. Finally found a manual install for imagemagick that did the trick. See https://coderwall.com/p/mwtoya?comment=Thanks.++After+fighting+for+hours%2C+this+was+the+solution

@obedeugene
Copy link

This is great. After days of searching, thissolved the problem. Thanks alot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment