I am a beginner with Ruby. I need to modify the database backend of an application (tracks) that currently uses Mysql as database(WORKS FINE WITH MYSQL). Need to change mysql backend database. Leant that Tracks application uses ActiveRecords and database.yml to talk to the database.
The database I am using is relatively unknown and uses a ODBC interface using a DSN name and so does not have a Ruby adapater for database.yml. I would have to use the ODBC approach thru database.yml right ?. But Tracks uses ACtiveREconds and I am using “ODBC” as the adapter name in the database.yml and the below corrosponding info. I get the following error with the modified database.yml.
The database.yml is below
production:
adapter: ODBC
dsn: new_dsn
username: track
password: track
C:\gtd\tracks>ruby script/server -e production
=> Booting WEBrick…
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems.rb:252:in `activate’: undefined method `
map’ for nil:NilClass (NoMethodError)
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems.rb:274:in `activate’
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems.rb:273:in `each’
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems.rb:273:in `activate’
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35:in `re
quire’
from C:/gtd/tracks/vendor/rails/activesupport/lib/active_support/depende
ncies.rb:153:in `require’
from C:/gtd/tracks/vendor/rails/activesupport/lib/active_support/depende
ncies.rb:521:in `new_constants_in’
from C:/gtd/tracks/vendor/rails/activesupport/lib/active_support/depende
ncies.rb:153:in `require’
from C:/gtd/tracks/vendor/rails/activerecord/lib/active_record/connectio
n_adapters/abstract/connection_specification.rb:72:in `establish_connection’
... 18 levels…
from C:/gtd/tracks/vendor/rails/railties/lib/commands/server.rb:49
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `ge
m_original_require’
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `re
quire’
from script/server:3
Additional info: For testing purposes, I wrote a small ruby program that uses DBI with ODBC data source name to connect to the database fine but need to make ot work thru database.yml and Activerecords for Tracks application.
