How do I get Ruby's DBI gem properly installed so that it can talk to MySql?
问题 On my Windows 7 box, I've installed Ruby 1.9.2, and installed the following gems: * LOCAL GEMS * dbd-mysql (0.4.4) dbi (0.4.5) deprecated (2.0.1) httparty (0.8.1) rubygems-update (1.8.15) (I did this using gem install). I have also written the following simple test harness: require 'rubygems' require 'dbi' begin dbh = DBI.connect("DBI:Mysql:test", "username", "pwd") row = dbh.select_one("SELECT VERSION()") puts "Server Version: "+row[0] rescue DBI::DatabaseError => e puts "An error occurred"