From: "R. Mark Volkmann" Date: 2005-04-02T12:21:37+09:00 Subject: Re: gems for DBI and MySQL? Quoting Kirk Haines : > R. Mark Volkmann wrote: > > > Does Rails use DBI to access databases? > > No. > > > Does Rails support MySQL out of the box? > > I'm not writing a web app. However, if the answer to both questions above > > is "yes" then it would seem that the easiest way to get myself setup to > > use MySQL > > would be to install Rails. True? > > No. > > It's easy to just do it by hand. > > Get mysql-ruby (http://tmtm.org/en/mysql/ruby/README.html), which is the C > interface, or ruby-mysql (http://tmtm.org/en/ruby/mysql/README_en.html), > which is the pure Ruby interface. Follow the easy instructions to build > this. > > Download DBI (http://rubyforge.org/projects/ruby-dbi). > > After unpacking ruby-dbi: > > ruby setup.rb config --with=dbi,dbd_mysql > ruby setup.rb setup > ruby setup.rb install This last step is a problem when you've installed Ruby using the one-click installer because it tries to overwrite existing .rb files. I had to delete the existing ones to get this to work. > You'll be good to go. When I run my code that contains dbh = DBI.connect('dbi:Mysql:music:localhost', 'root', '') I get c:/Ruby/Ruby1.8.2-14/lib/ruby/site_ruby/1.8/dbi/dbi.rb:490:in `load_driver': is not a class/module (TypeError) from c:/Ruby/Ruby1.8.2-14/lib/ruby/site_ruby/1.8/dbi/dbi.rb:392:in `_get _full_driver' from c:/Ruby/Ruby1.8.2-14/lib/ruby/site_ruby/1.8/dbi/dbi.rb:372:in `connect' I looked at the code. I think it's complaining about not being able to find a class called DBI::DriverHandle. That class is defined in dbi.rb. Any idea what's going on here? -- R. Mark Volkmann Partner, Object Computing, Inc.