Markus Jais wrote:
> hi,
> I installed Ruby dbi on my Red Hat 7.1
> I have ruby1.6.4 and the mysql-rpms from the
> RH cd.
> 
> I translated a short perl script to ruby:
> 
> --------
> require "dbi"
> 
> dbh = DBI.connect("dbi:mysql:products", "markus", "passwd")

Try:  "dbi:Mysql:database=products"

Sorry for the inconvenience.
DBI 0.0.6 will include case-insensitive DBI URLs as well
a short form for database=...; 



> sql = "SELECT code , description FROM stock";
> sth = dbh.prepare(sql)
> 
> res = Array.new
> res = sth.execute
> 
> res.each { |elem|
> 	print elem, "\n"
> }
> ------
> 
> I got the following error:
> 
> /usr/local/lib/ruby/1.6/dbi/dbi.rb:289:in `load_driver': Could not load
> driver (No such file to load -- DBD/mysql/mysql) (DBI::InterfaceError)
>         from /usr/local/lib/ruby/1.6/dbi/dbi.rb:252:in `connect'
>         from ./dbi1.rb:5
> 
> I saw that the mysql directory unter DBD was written with
> an uppercase "M" as well as Mysql.rb.
> after renaming it to lowercase,  (DBD/mysql/mysql.rb )it seemed to work
> but prodocuced another error:
> 
> /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:289:in `load_driver': Could
> not load driver (libmysqlclient.so.6: cannot load shared object file: No
> such file or directory - /usr/local/lib/ruby/1.6/i686-linux/mysql.so)
> (DBI::InterfaceError)
>         from /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:252:in
> `connect'
>         from ./dbi1.rb:5

Have you installed the Mysql Ruby Module available from RAA?
The DBD::Mysql is currently just a wrapper around this,
as long as someone writes a Mysql DBD in pure C :-)

> after a
> $ ln -s  libmysqlclient.so.10.0.0 libmysqlclient.so.6 
> $ ldconfig
> under /usr/lib/mysql
> 
> I got the following error:
> /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:282: [BUG] Segmentation
> fault
> ruby 1.6.4 (2001-06-04) [i686-linux]
> Aborted (core dumped)
> 
> does anybody have an idea what went wrong????
> I think the first error can is an error in the install script.
> 
> do you already know when the next version will be out??


0.0.6 will be released when the case-insensitive DBD URL as well
as the parser is out.
I hope this week.  Stay tuned.



Regards,

  Michael

-- 
Michael Neumann
merlin.zwo InfoDesign GmbH
http://www.merlin-zwo.de