Oracle, ODBC and Rails

Hi,

I have successfully connected to a remote ORACLE DSN using the Actual ODBC driver (www.actualtechnologies.com) and the ODBC binding for Ruby by Chris Werner (ODBC Binding for Ruby).

However, when I attempt to connect via ODBC from Ruby on Rails, I get the following error when starting the web server:

/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 34: uninitialized class variable @@allow_concurrency in ActiveRecord::Base (NameError)

In addition to the ODBC binding mentioned above, I have also installed OpenLink's ODBC adapter for Ruby on Rails (http://odbc- rails.rubyforge.org/).

I'm running Rails 1.2.3 on Mac OS X 10.4.9 (Intel). My Oracle database is version 10g.

Have you seen this error and/or do you have any idea why it may be occuring?

Can you share any resources describing how people have successfully used an Oracle ODBC driver with Ruby on Rails?

Thanks, Jeff

hi,

hi

Thanks Andrew. The problem is that the Mac OS X Oracle products are compiled for PPC, not for Intel. I can actually run the Oracle Instant Client independently (it is supported via Rosetta), but apparently it doesn't play with Ruby or Rails -- that's why I'm giving ODBC a try.

Thanks Luca. You're right about the odbc parameter in database.yml. I'm definitely using it and it results in error in my original post.

Is the error you're getting specific to the Actual ODBC driver? Have you tried one of OpenLink's ODBC drivers for Oracle?

The error occurs when loading OpenLink's ODBC ActiveRecord Adapter (which is a layer between ActiveRecord and the ODBC driver). I was not aware that OpenLink has ODBC drivers for Oracle. Perhaps I'll give that a shot.

Thanks, Jeff

I'm in the same boat, using an Intel (x86) Mac and trying to connect to an Oracle database.

I'm currently using: OpenLink ODBCAdapter: http://rubyforge.org/projects/odbc-rails/ Ruby ODBC Bindings: ODBC Binding for Ruby Actual Technologies ODBC driver: http://www.actualtechnologies.com/ ($30)

I haven't been able to get this configuration working correctly rake db:schema:dump is failing on this line of odbc_adapter.rb in method 'columns':

isNotNullable = (odbcIsNullable.match('NO') != nil)

since odbcIsNullable is nil with this error: You have a nil object when you didn't expect it! The error occurred while evaluating nil.match