Anybody know what this is about?
Installing ruby dbi on:
ArchLinux
Ruby 1.8.1
Ruby DBI .21
I run this:
% ruby setup.rb config --with=dbi,dbd_mysql
% ruby setup.rb setup
% ruby setup.rb install
Everything seems to install fine. Then I test it with this program:
# simple.rb - simple MySQL script using Ruby DBI module
require “dbi”
begin
# connect to the MySQL server
dbh = DBI.connect(“dbi:Mysql:test:localhost”, “testuser”, “testpass”)
# get server version string and display it
row = dbh.select_one(“SELECT VERSION()”)
puts "Server version: " + row[0]
rescue DBI::DatabaseError => e
puts "An error occurred"
puts "Error code: #{e.err}"
puts "Error message: #{e.errstr}"
ensure
# disconnect from server
dbh.disconnect if dbh
end
and I get the following error:/usr/lib/ruby/site_ruby/1.8/dbi/dbi.rb:490:in load_driver': is not a class/module (TypeError) from /usr/lib/ruby/site_ruby/1.8/dbi/dbi.rb:392:in
_get_full_driver’ from /usr/lib/ruby/site_ruby/1.8/dbi/dbi.rb:372:in `connect’ from simple.rb:5Thanks for any help at all in advance!!
Nevermind, I figured it out myself.
I realized I needed a program called MySQL Ruby Module ver2.4.5.
Found it on a mostly japanese site. I think it was a small miracle that I
got it to work.
Any hope of DBI getting included in the standard distribution someday. How
can anyone function without databases these days?
···
----- Original Message -----
From: “Shanon Fernald” info@irvinehosting.net
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, March 22, 2004 11:05 PM
Subject: ruby dbi installation issue
Anybody know what this is about?
Installing ruby dbi on:
ArchLinux
Ruby 1.8.1
Ruby DBI .21
I run this:
% ruby setup.rb config --with=dbi,dbd_mysql
% ruby setup.rb setup
% ruby setup.rb install
Everything seems to install fine. Then I test it with this program:
# simple.rb - simple MySQL script using Ruby DBI module
require “dbi”
begin
# connect to the MySQL server
dbh = DBI.connect(“dbi:Mysql:test:localhost”, “testuser”, “testpass”)
# get server version string and display it
row = dbh.select_one(“SELECT VERSION()”)
puts "Server version: " + row[0]
rescue DBI::DatabaseError => e
puts "An error occurred"
puts "Error code: #{e.err}"
puts "Error message: #{e.errstr}"
ensure
# disconnect from server
dbh.disconnect if dbh
end
and I get the following error:/usr/lib/ruby/site_ruby/1.8/dbi/dbi.rb:490:in
load_driver': is not a class/module (TypeError) from /usr/lib/ruby/site_ruby/1.8/dbi/dbi.rb:392:in
_get_full_driver’ from
/usr/lib/ruby/site_ruby/1.8/dbi/dbi.rb:372:in `connect’ from
simple.rb:5Thanks for any help at all in advance!!
Shanon Fernald wrote:
Nevermind, I figured it out myself.
I realized I needed a program called MySQL Ruby Module ver2.4.5.
Found it on a mostly japanese site. I think it was a small miracle
that I got it to work.
Any hope of DBI getting included in the standard distribution
someday. How
I second that request. And that at least a few drivers for the most
common databases also be included.
The RubySumo project was going to be doing something like that, but I
haven’t noticed much from them lately (of course, I haven’t checked…).