Skip to content

Instantly share code, notes, and snippets.

@somebox
Forked from anonymous/snippet.txt
Created August 17, 2010 14:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somebox/530129 to your computer and use it in GitHub Desktop.
Save somebox/530129 to your computer and use it in GitHub Desktop.
Installing the mysql gem on OSX

Mysql gem under OSX:

Install:

option 1:

Try to use existing mysql under OSX.

$ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

option 2:

Go to mysql.com, download and install the 64-bit OSX 5.1 .DMG installer.

$ sudo env ARCHFLAGS="-arch x86_64" gem install -V mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

option 3:

With MacPorts, install mysql5 and mysql5-devel.

$ sudo gem install -V mysql -- --with-mysql-config=/opt/local/bin/mysql_config5

Testing it:

$ irb
>> require 'rubygems'
=> false
>> require 'mysql_api'
=> true
>> Mysql.get_client_info 
=> "5.1.34"
>> Mysql.get_client_version
=> 50134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment