I have seen other people with the same issue of installing RMagick on Mountain Lion However none of the suggested solutions have allowed me to successfully install rmagick.
What we did was the following:
cd /usr/local
git checkout 834ce4a Library/Formula/imagemagick.rb
brew install imagemagick
This will install Imagemagick 6.7.7-6
I know this is old, but I have been through a bunch of these responses and still wasn't able to get it to work. I found a random link in another language which actually solved the problem for me (http://sugiarto.webmuapp.com/Package_MagickCore_was_not_found_in_the_pkg_config_search_path). It looks like it was looking for PKG_CONFIG_PATH which was not set up.
What worked for me:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Then make sure it worked:
find /usr -name 'MagickCore.pc'
/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/MagickCore.pc
/usr/local/lib/pkgconfig/MagickCore.pc
Then try installing rmagick again:
gem install rmagick
Building native extensions. This could take a while...
Successfully installed rmagick-2.13.2
1 gem installed
Installing ri documentation for rmagick-2.13.2...
Installing RDoc documentation for rmagick-2.13.2...
Success! Hope this helps anyone else still running into this issue.