Rails & dbd-odbc error

Hi – I’m trying to get my rails app on OSX 10.5.5 to connect to SQL
Server with ruby dbi, and am getting the following error:

/usr/local/lib/ruby/gems/1.8/gems/dbd-odbc-0.2.4/lib/dbd/ODBC.rb:57:
warning: already initialized constant VERSION
/usr/local/lib/ruby/gems/1.8/gems/dbd-odbc-0.2.4/lib/dbd/ODBC.rb:58:
warning: already initialized constant DESCRIPTION
DBI::InterfaceError: Could not load driver (uninitialized constant
DBI::TypeUtil)
from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:368:in load_driver' from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:233:in_get_full_driver’
from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:219:in connect' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:46:insqlserver_connection’
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
send' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:innew_connection’
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
checkout_new_connection' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:incheckout’
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
loop' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:incheckout’
from /usr/local/lib/ruby/1.8/monitor.rb:238:in synchronize' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:incheckout’
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
connection' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:inretrieve_connection’
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:121:in
retrieve_connection' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:113:inconnection’
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1214:in
table_exists?' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1353:ininspect’
from /usr/local/lib/ruby/1.8/irb.rb:298:in output_value' from /usr/local/lib/ruby/1.8/irb.rb:151:ineval_input’
from /usr/local/lib/ruby/1.8/irb.rb:259:in signal_status' from /usr/local/lib/ruby/1.8/irb.rb:147:ineval_input’
from /usr/local/lib/ruby/1.8/irb.rb:146:in eval_input' from /usr/local/lib/ruby/1.8/irb.rb:70:instart’
from /usr/local/lib/ruby/1.8/irb.rb:69:in catch' from /usr/local/lib/ruby/1.8/irb.rb:69:instart’
from /usr/local/bin/irb:13>> exit

Can anyone suggest where I might look to find fixes for this?
Cheers,
Doug.

Isn’t ODBC only available on Windows boxes?

Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/
(en)

On Sun, Dec 21, 2008 at 2:16 PM, Doug L.

you can get the equivalent on Linux using freeTDS and uniODBC, which is
a
funish setup

On Mon, 22 Dec 2008 06:27:17 +0900, Maurício Linhares

No, I’m using FreeTDS and iODBC on the Mac, and FreeTDS with unixODBC on
Ubuntu.
Although not with any notable success on either, so far!
Doug.

I followed the following instructions on Linux and it all worked pretty
much straight away:
http://wiki.rubyonrails.org/rails/pages/HowtoConnectToMicrosoftSQLServerFromRailsOnLinux

They also have OS instructions -
http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer

Simon

On Mon, 22 Dec 2008 06:35:51 +0900, Doug L.