First install MySQL/Ruby. The following will work for most setups:
% curl http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz -o mysql-ruby-2.7.tar.gz % tar zxvf mysql-ruby-2.7.tar.gz % cd mysql-ruby-2.7 % ruby extconf.rb --with-mysql-config % make % ruby test.rb [hostname] [username] [dbpassword] % make install # as superuser
If your configuration is slightly different, check the MySQL/Ruby page for more detailed setup info.
Please note that MySQL/Ruby has some known issues on certain architectures. If you have strange segfaults while running MySQL/Ruby tests, we recommend that you install Ruby/MySQL instead. Make sure that MySQL/Ruby is uninstalled, so that Ruby-DBI will unambiguously know which library to load.
In case you're wondering: MySQL/Ruby and Ruby/MySQL, both written by Tomita Masahiro, are two implementations of the same API in C and pure Ruby, respectively. Ruby/MySQL is mildly slower, but both look the same from the outside, and to Ruby-DBI.