Rails 2.3 and Mysql on Leopard

I recently had a crash on an old PowerPC server and had to reinstall Leopard and Rails 2.3.

It is not as straight forward as one would hope – here are the steps.

  1. Install Leopard
  2. Install XCode 3.0 from the Leopard DVD
    Note that the CHUD part of the XCode install consistently caused a crash on my PowerPC.
    If this happens to you, Customise your XCode install, and select only options 1 and 3 (not the CHUD part)

  3. Install mysql from http://dev.mysql.com/downloads/mysql/5.0.html
    Also install the preference pane and start mysql server.

  4. Activate the root user in Leopard

    http://www.macosxhints.com/article.php?story=20071025100950309

  5. Upgrade rails (Leopard ships with Rails 1.2)
    1
    2
    3
    4
    sudo gem update --system
    sudo gem install rails
    sudo gem update rake
    sudo gem install ruby-debug

    If you get error messages that ruby.h can’t be found, your XCodes install has not been successful.

  6. Add mysql gem
    Rails 2 does not come with the mysql gem installed.
    This requires a special command
    On Intel Macs

    1
    sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql dir=/usr/local/mysql --with-mysql-config=`which mysql_config`

    On a PowerPC

    1
    sudo env ARCHFLAGS="-arch ppc" gem install mysql -- --with-mysql dir=/usr/local/mysql --with-mysql-config=`which mysql_config`

Any comments or corrections welcome.

Similar Posts