Forum: Ruby Newbie - Problem One - Ruby and MySQL

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-01-04 23:56
(Received via mailing list)
I have ruby, apache and MySQL installed via instantrailson Windows XP
sp2. All work independently OK.

I am attempting to access the MySQL, but up to now no success.

After searching the web. have tried

require 'dbi'

require 'mysql'

but both have not been found.  What is the correct require '' and a
pointer to a code snippet, which connected to a database and select
rows would be most helpful.

It may be something to do with 'activerecord, but
require 'active_record' does not find any code either.


X-Man (Guest)
on 2006-01-05 02:00
(Received via mailing list)
There is no native Ruby to MySQL adapter under Windows. That is why
each of the pieces work independently, but you are frustrated. (This is
why I use Sqlite3 instead of MySQL) You can build your own adapter
under Cygwin, apparently, but I think it's too much pain for the

If you must, here's the link from the guy who wrote a book on MySQL ...
Search for the word "Windows".

And here's some complex (but good?) instructions on how to set up the
whole enchilada for Eclipse, which seems to include a way to get at the
database without Cygwin. The JDBC connector seems to be involved - not
sure. ...

Hope this helps --- And if you do decide to build some adapter for
Windows, upload it for us ;-)
Jon B. (Guest)
on 2006-01-05 03:39
(Received via mailing list)
If it is a gem you should do:

require 'rubygems'
require 'mysql' (etc)

If im not mistake you should adjust your RUBY_LIB env path to point to
your site_ruby directory.  (so require can find packages ok)

- Jon
This topic is locked and can not be replied to.