J.Hawkesworth wrote:
> Greg,
> Show us your code - given that it is failing on line 5 hopefully it is
> something simple.
> All the best,
> Jon
> 
> -----Original Message-----
> From: Greg Brondo [mailto:greg / brondo.com]
> Sent: 12 March 2003 17:55
> To: ruby-talk ML
> Subject: Problem with Mysql in win ruby 1.6.8
> 
> 
> I've installed the PP 1.6.8 version of Ruby for windows.  It comes with 
> DBI and Mysql support.  However, when I run a test.rb script I wrote 
> (basically the stuff from the Mysql-DBI homepage).  I get this error:
> 
> c:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:424:in `load_driver': Could 
> not load driver (uninitialized constant Mysql at DBI::DBD) 
> (DBI::InterfaceError)
>          from c:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:339:in 
> '_get_full_driver'
>          from c:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:319:in `connect'
>          from C:\webdev\LLI-FRN\test.rb:5
> 
> Any help at all would be appreciated.  I'm working on a project and 
> would like to use webrick with mysql on windows.
> 
> BTW -- I've even gone down the path of attempting to compile it myself 
> with mingw/msys, but I cannot seem to get configure to work.
> 
> Thanks!
> Greg Brondo
> greg / brondo.com
> 
> 
> 
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________
> 
> _____________________________________________________________________
> This message has been checked for all known viruses by Star Internet delivered
> through the MessageLabs Virus Control Centre. For further information visit
> http://www.star.net.uk/stats.asp
> _____________________________________________________________________
> Any views or personal opinions expressed within this email may not be those of Talis Information Ltd.
> The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.
> 
require 'dbi'

begin
     # connect to the MySQL server
     dbh = DBI.connect("DBI:Mysql:test", "root", "")
     # get server version string and display it
     row = dbh.select_one("SELECT VERSION()")
     puts "Server version: " + row[0]
     dbh.select_all("select * from types") do |row|
       puts row[0].to_s + "  " + row[1]
     end
rescue DBI::DatabaseError => e
     puts "An error occurred"
     print "Error code: ", e.err, "\n"
     print "Error message: ", e.errstr, "\n"
ensure
     # disconnect from server
     dbh.disconnect if dbh
end


'Child' suggested that maybe I do not have the Mysql DBI stuff 
installed.  I downloaded the mysql-win package and ran install.rb.  It 
said everything installed fine but I still receive the error.  I can 
access the DB through DBI:ODBC but I prefer a more native approach.
I'm using Ruby installer 1.6.8 which according to the docs includes 
everything I need (at least I think -- I'm coming from Python so some of 
this is a bit trickier to get working on Windows).

Thanks!
Greg Brondo