Installing MySQL Ruby Gem in Snow Leopard Server

Snow Leopard Server doesn’t come with MySQL client and library files.
In order to get them we need to download a package, for Snow Leopard Server 10.6.2:
http://www.opensource.apple.com/other/MySQL-49.binaries.tar.gz (71.2MB)

The main entry page should be http://www.opensource.apple.com/release/mac-os-x-1062/ but I cannot find the package there, getting the url was guess work from reading an Apple support page: http://support.apple.com/kb/TA25017

What we are doing is to uncompress a archive directly in our root.
Once you get the file you should decompress it unless your browser already did for you.
Since Safari did it for me I’m having MySQL-49.binaries.tar in my Downloads folder.

Open up a terminal.

cd Downloads
sudo tar -xvf MySQL-49.binaries.tar -C / # use -zxvf if you still have the .tar.gz file

We should have the required libraries in order to install the MySQL Ruby Gem.

You may have already read the previous articles about MySQL and Ruby, however the procedure is different:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql

This should give you a working installation of MySQL Gem.

$1.99 domains with SSL purchase!

18 thoughts on “Installing MySQL Ruby Gem in Snow Leopard Server

  1. Pingback: Installing MySQL Ruby Gem in Snow Leopard Server « iCoreTech … Mac Ruby

  2. Pingback: I AM OSX » Installing MySQL Ruby Gem in Snow Leopard Server « iCoreTech …

  3. Pingback: Installing MySQL Ruby Gem in Snow Leopard Server « iCoreTech … Mac Apple

  4. Pingback: Installing MySQL Ruby Gem in Snow Leopard Server « iCoreTech … RubyCocoa

  5. Just one question, do you know why Apple don’t distribute officially this binaries. It’ll be more easy for every body ?

  6. Did not work on my new Mac Mini Server. I get the following:

    server:~ hostadmin$ sudo env ARCHFLAGS=”-arch x86_64″ gem install mysql
    Password:
    Building native extensions. This could take a while…
    ERROR: Error installing mysql:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
    mkmf.rb can’t find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

    Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
    Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

    Any ideas on what I’m doing wrong?

  7. Pingback: Setting up redmine on a mac server « Energetic Blues

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">