Forum: Ruby on Rails Rails & dbd-odbc error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2837408ba0375c40b235f0a5a5107d37?d=identicon&s=25 Doug Livesey (biot023)
on 2008-12-21 18:16
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:in
`sqlserver_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:in
`new_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:in
`checkout'
  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:in
`checkout'
  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:in
`checkout'
  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: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: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:in
`connection'
  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:in
`inspect'
  from /usr/local/lib/ruby/1.8/irb.rb:298:in `output_value'
  from /usr/local/lib/ruby/1.8/irb.rb:151:in `eval_input'
  from /usr/local/lib/ruby/1.8/irb.rb:259:in `signal_status'
  from /usr/local/lib/ruby/1.8/irb.rb:147:in `eval_input'
  from /usr/local/lib/ruby/1.8/irb.rb:146:in `eval_input'
  from /usr/local/lib/ruby/1.8/irb.rb:70:in `start'
  from /usr/local/lib/ruby/1.8/irb.rb:69:in `catch'
  from /usr/local/lib/ruby/1.8/irb.rb:69:in `start'
  from /usr/local/bin/irb:13>> exit


Can anyone suggest where I might look to find fixes for this?
Cheers,
   Doug.
A91bd6cef23eb3516245a092e196c4da?d=identicon&s=25 Maurício Linhares (mauricio)
on 2008-12-21 22:28
(Received via mailing list)
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 Livesey
41cc2c53544016a86472343ab3fdc0ff?d=identicon&s=25 Simon Macneall (Guest)
on 2008-12-21 22:35
(Received via mailing list)
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
2837408ba0375c40b235f0a5a5107d37?d=identicon&s=25 Doug Livesey (biot023)
on 2008-12-21 22:35
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.
41cc2c53544016a86472343ab3fdc0ff?d=identicon&s=25 Simon Macneall (Guest)
on 2008-12-21 22:54
(Received via mailing list)
I followed the following instructions on Linux and it all worked pretty
much straight away:
http://wiki.rubyonrails.org/rails/pages/HowtoConne...

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

Simon

On Mon, 22 Dec 2008 06:35:51 +0900, Doug Livesey
This topic is locked and can not be replied to.