From: Erik Hollensbe Date: 2008-10-15T16:20:19+09:00 Subject: Re: Using DBI and MySQL gems Owein Herrmann wrote: > Quick question: > > I thought using rubygems that to use the dbi and mysql to access a MySQL > database from Ruby I would only have to do the following: > > gem 'mysql' > gem 'dbi' > > and then I could do whatever, eg: > > dbh = DBI.connect('DBI:Mysql:money', 'mysqluser', 'pass3') > > HOWEVER, what I have to do is: > > gem 'mysql' > gem 'dbi' > require 'dbi' Unless rubygems has (recently) changed, the 'gem' command doesn't issue any requires, it just modifies the load path to point at your gem. I don't know if this is recommended usage anymore, but provided you haven't installed dbi with the provided setup.rb, "require 'dbi'" should work without the gem statements. -Erik -- Posted via http://www.ruby-forum.com/.