Upgrading Rails, Gems, and MySQL to Snow Leopard
Have been meaning to post this for a while. I have an older MBP that came with OS X version 10.4, and after upgrading to 10.6 my entire coding stack collapsed. After a couple of hours here is the solution I came up with.
First, find what processor you are running on, ie 32 or 64 bit. If you don’t know use this guide http://support.apple.com/kb/ht3696
Second, download and install the appropriate MySQL version from http://dev.mysql.com/downloads/mysql. In my case it was 64-bit MySQL 5.1.37.
After that you’ll need to install ruby gems from scratch. You can find more details in my other post How to setup RoR+Passenger+MySql+Ubuntu Server on EC2,but here is an excerpt bash script with all you need:
echo Installing ruby gems... cd /usr/local/src sudo wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz sudo tar -zvxf rubygems-1.3.5.tgz cd rubygems-1.3.5/ sudo ruby setup.rb echo Symlinking... sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb
Note: If you find that the gem command still won’t run try this
sudo ln -s /usr/bin/gem /usr/local/bin/gem
Finally, execute the following:
sudo gem update --system sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Note: make sure you set ARCHFLAGS flag to the appropriate architecture.
Good luck and enjoy your new OS.