Mysql, Rmagick on Snow Leopard, Homebrew to the rescue!
Well after sitting on my install disks for a few months I finally figured I better upgrade my primary MacBook Pro. As expected, my rails projects and several other things did not function…. Rmagick and MySql were borked as well..
After spending several nights reinstalling Xcode, updating my macports, trying to compile from src to no avail I had someone recommend Homebrew to me. At first I figured.. meh.. another package manager that won’t work… suprisingly.. it did!.. Macports is garbage in comparison.. so to get to the good stuff.. here’s the steps to take if you find yourself in this situation!
1) Best to start clean.. first thing was to wipe the macports installs.
sudo port -f uninstall installed
sudo rm -rf /opt/local \
/Applications/MacPorts \
/Applications/DarwinPorts \
/Library/Tcl/macports1.0 \
/Library/Tcl/darwinports1.0 \
/Library/LaunchDaemons/org.macports.* \
/Library/StartupItems/DarwinPortsStartup \
/Library/Receipts/MacPorts*.pkg \
/Library/Receipts/DarwinPorts*.pkg \
~/.macports
2) Download and install the latest XCode development tools.. your DVD is probably out of date. Ensure that the optional components for command line development are installed (“Unix Development” in the Xcode 3.x installer). Also include the X11 items.
3) Rebooted and hold down ‘6′ and ‘4′ keys to switch to 64 bit mode… (by default snow leopard boots in 32 bit mode.. you can check this in the System Profiler).
4) Install homebrew
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz –strip 1 -C /usr/local
brew install git
5) Install mysql
brew install mysql
export ARCHFLAGS=”-arch i386 -arch x86_64″
gem install mysql — –with-mysql-dir=/usr/local \
–with-mysql-config=/usr/local/bin/mysql_config
6) Install imagemagick
brew install imagemagick
and finally:
7) sudo gem install rmagick