DBI/DBD for MySQL

M

Michael Perle

Hi there,

I am a bit confused about the installation for DBI/DBD.

- Is the default build/install of Ruby 1.8.4
not including the DBI module?
- If no: Is there no Gem available for DBI?
- Is the MySQL DBD not part of the Windows
binary distribution of Ruby 1.8.2? 1.8.4?
- Is there a way to install the DBD module
on my laptop where I have no make/gcc/...?

Another question I was asking myself:
When upgrading Ruby, I normally remove and
re-install. Is that the normal way to go?

Thank you for any help
MP

-------------------------------------------------------
Just in case you want to know why I am asking --
but of course you may stop reading and citing here ;-)

Ruby is installed on both
my Linux server (Ruby 1.8.4, build by me) and on
my Windows laptop (Ruby 1.8.2, binary distribution).

On both system Rails is installed, too;
a Rails application using MySQL is working
on the Windows system. On Linux none yet done.

For a Ruby (not Rails) app I need a connection
to MySQL and would like to use DBI.

On Linux (Ruby 1.8.4) the
require 'dbi'
fails already, so it looks like dbi is not installed.

On Windows (Ruby 1.8.2) the require seems ok
but when I try the DBI.connect - is ok on the Win laptop (Ruby 1.8.2)

c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:499:in `load_driver':
is not a class/module (TypeError)
from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:401:
in `_get_full_driver'
from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:381:in `connect'
from c:/test/test.rb:5

I would say the DBD for MySQL is not installed.
 
D

Daniel Berger

Michael said:
Hi there,

I am a bit confused about the installation for DBI/DBD.

- Is the default build/install of Ruby 1.8.4
not including the DBI module?
It's not not part of the stdlib. It's bundled with the one-click
installer for Windows, though.
- If no: Is there no Gem available for DBI? Not yet.

- Is the MySQL DBD not part of the Windows
binary distribution of Ruby 1.8.2? 1.8.4?
Yes, but the underlying driver is not.
- Is there a way to install the DBD module
on my laptop where I have no make/gcc/...?
The DBD is just an interface for an underlying driver. You don't need
to *build* dbd-mysql, just install it. It's a wrapper for
http://raa.ruby-lang.org/project/mysql-ruby/.
Another question I was asking myself:
When upgrading Ruby, I normally remove and
re-install. Is that the normal way to go?
That's what I do.

c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:499:in `load_driver':
is not a class/module (TypeError)
from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:401:
in `_get_full_driver'
from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:381:in `connect'
from c:/test/test.rb:5

I would say the DBD for MySQL is not installed.
The underlying driver is not installed.

Regards,

Dan
 
M

Michael Perle

Daniel said:
The DBD is just an interface for an underlying driver. You don't need
to *build* dbd-mysql, just install it. It's a wrapper for
http://raa.ruby-lang.org/project/mysql-ruby/.

Thank you. Understood.
Tried the pure Ruby MySQL driver.
Unfortunately my MySQL version's authentication
is not yet supported by the available module.

On Linux I didn't try yet, but there I will use
the native driver.

MP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top