Ruby and MySQL and Cocoa

Jun 16, '04 11:59:00AM

Contributed by: Nimitz

Amongst a lot of other great stuff, MacOS X 10.3 ships with MySQL and Ruby. Ruby, for you die-hard php/perl fans out there, is a splendid object-orientated language that performs very well on the Mac, too. You can even integrate it in the Aqua environment by using Cocoa classes -- check out Ruby central and RubyCocoa.

Download the package at dev.mysql.com, unpack it and type the following in the folder where the install data resides.:
  1. ruby extconf.rb --with-mysql-include=/usr/local/mysql/include
    --with-mysql-lib=/usr/local/mysql/lib --with-mysql-dir=/usr/local/mysql
  2. sudo make
  3. ruby -I. test.rb localhost username password ... of course, replace username and password with your access data
  4. sudo make install
  5. include the require "mysql" statement in your rubyscript.
Have fun!

Comments (6)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040614173314772