MySQL Forums
Forum List  »  Ruby

Re: MySQL gem Installation Problems
Posted by: Justin Too
Date: July 01, 2008 12:32PM

>ruby mysqltest.rb
c:/ruby/lib/ruby/site_ruby/1.8/dbi.rb:329:in `load_driver': Unable to load driver 'Mysql' (DBI::InterfaceError)
from c:/ruby/lib/ruby/site_ruby/1.8/dbi.rb:227:in `_get_full_driver'
from c:/ruby/lib/ruby/site_ruby/1.8/dbi.rb:213:in `connect'
from mysqltest.rb:7
>Exit code: 1


from running

#!/usr/bin/ruby -w

require "dbi"

begin
# connect to the MySQL server
dbh = DBI.connect("DBI:Mysql:TESTDB: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

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL gem Installation Problems
July 01, 2008 12:32PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.