Hello,
I've installed successfully DBI using Ruby 1.8.6 on Mac OS X 10.4.10. The problem I'm having is that I can't connect to a MySQL database since the error I get is the following:
$ty5:~/Desktop ty5$ ruby dbconnect.rb
/usr/local/lib/ruby/site_ruby/1.8/dbi.rb:344:in `load_driver': Could not load driver (no such file to load -- mysql) (DBI::InterfaceError)
from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:227:in `_get_full_driver'
from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:213:in `connect'
from dbconnect.rb:9
I've checked that the MySQL driver for DBI is installed and it is:
ty5:/usr/local/lib/ruby/site_ruby/1.8/DBD/Mysql ty5$ ls -l
total 40
-rw-r--r-- 1 root wheel 19857 Aug 18 13:50 Mysql.rb
And so is the Postgres driver:
ty5:/usr/local/lib/ruby/site_ruby/1.8/DBD/Pg ty5$ ls -l
total 56
-rw-r--r-- 1 root wheel 24630 Aug 18 14:18 Pg.rb
The connect code I'm using is:
dbh = DBI.connect('DBI:Mysql:test', 'username', 'password')
So I'm kind of stuck at this point since everything seems correct to me! Any help would be most welcomed!
Thanks!
|