Hi Folks,
I am running Ruby 1.9 (ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10]) on Slow Leopard (installed via MacPorts).
I then installed the Ruby MySQL client library via MacPorts: install rb19-mysql
Trying to use it I get the following error:
db.rb:4:in `initialize': wrong number of arguments(4 for 0) (ArgumentError) from db.rb:4:in `new' from db.rb:4:in `'
My code:
require 'mysql'
require 'pp'
dbh = Mysql.new("localhost", "testuser", "testpass", "test")
puts "Server version: " + dbh.get_server_info
It seems like I am missing something very basic here.
Did I install the right client library? I am using it correctly? Am I missing some other dependencies?
Would appreciate if someone could point me in the right direction.
Thanks!