[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem with Ruby ODBC in Linux

Sam Kong

9/10/2007 8:30:00 PM

Hi,

I am trying to connect to a SQL Server 7.0 DB from a Linux box using
Ruby DBI & ODBC.

1. ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]

2. ruby-odbc installed ok.
ruby-odbc-0.9995> ruby test.rb dsn_name username password
all tests ok!

3. DBI is properly installed.
irb> require 'dbi'
=> true

BUT, the following fails in the same irb session.

irb> DBI.connect('dbi:ODBC:dsn_name', 'username', password')
DBI::InterfaceError: Unable to load driver 'ODBC'
...

What is missing?
Or how can I track it down?

Mysql works fine.
I believe I set up the ODBC configuration correctly.
I can access the SQL Server via isql command.

Thanks.

Sam
--
Posted via http://www.ruby-....

1 Answer

Sam Kong

9/10/2007 8:39:00 PM

0

I fixed the problem.

I reinstalled Ruby DBI.

ruby setup.rb config --with=dbi,dbd_odbc
ruby setup.rb setup
ruby setup.rb install

I think the --with=dbi,dbd_odbc made the difference.


Sam
--
Posted via http://www.ruby-....