Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save arnaudsj/178240 to your computer and use it in GitHub Desktop.
Save arnaudsj/178240 to your computer and use it in GitHub Desktop.
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
Upgrade your MySQL binary to the 64-bit one:
Bring down the existing mysqld if it’s running.
Install the binary: http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg
You want the Mac OS X 10.5 (x86_64) version.
Boot that sucker up:
$ sudo /usr/local/mysql-5.1.37-osx10.5-x86_64/bin/mysqld_safe
Bring your old data into the new database:
Create /etc/my.cnf and fill it with
[mysqld]
datadir=/usr/local/mysql-5.0.51b-osx10.5-x86/
Bring over the data
$ sudo mysql_upgrade
Remove /etc/my.cnf
$ sudo rm /etc/my.cnf
== Update MacPorts
You get to reinstall all your ports. Ugh.
Save a list of your installed ports:
$ port installed > myports.txt
Blow them all away (or at least mv) your /opt/local
$ rm -rf /opt/local
Install the latest version of MacPorts for Snow Leopard
http://distfiles.macports.org/MacPorts/MacPorts-1.8.0-10.6-SnowLeopard.dmg
Install your favourites, taking cues from the myports.txt list
$ sudo port install libxml2 p5-app-ack ImageMagick memcached ragel unrar
$ sudo port install git-core +bash_completion +doc
== Update MySQL gem
$ sudo gem uninstall mysql
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
== Update the rest of your gems
$ irb
irb> `gem list`.each_line {|line| `sudo env ARCHFLAGS="-arch x86_64" gem install #{line.split.first}`}
=== You’re done! ===
== References
http://stackoverflow.com/questions/991708/rails-mysql-and-snow-leopard
http://afreshcup.com/2008/10/06/upgrading-mysql-50-to-51-on-os-x/
http://blog.costan.us/2009/07/rebuild-your-ruby-gems-if-you-update-to.html
http://norbauer.com/notebooks/code/notes/snow-leopard-upgrading-for-rails-developers
http://trac.macports.org/wiki/Migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment