# Problem with Ruby ODBC in Linux

**URL:** <https://www.ruby-forum.com/t/problem-with-ruby-odbc-in-linux/114283>\
**Category:** Ruby\
**Created:** [September 10, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-odbc-in-linux/114283 "2007-09-10T22:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [September 10, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-odbc-in-linux/114283/1 "2007-09-10T22:30:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [September 10, 2007, 10:39pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-odbc-in-linux/114283/2 "2007-09-10T22:39:10Z")

</div>

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
