There are two modules for connecting to a MySQL database server from Ruby:
MySQL/Ruby and Ruby/MySQL are both written and maintained by Tomita "tommy" Masahiro.
Ruby DBI is a database-independent API for Ruby that uses the above modules to work with MySQL.
You can install MySQL/Ruby using the Ruby Gems packaging manager:
$ sudo gem install mysql