Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread
Message: 93195
BY: Chris Cropley (ccropley)
DATE: 2010-03-30 15:54
SUBJECT: Connect Ruby to SQL Server 2008 R2

 

I am posting this request for help because I am completely at a loss. I have trawled through various forums and I am still unable to find a solution.

I may just be a (to coin a Homer Simpson phrase) stoopid head!

Put simply I am trying to connect Ruby to SQL Server DB Engine running on the network. I am running Windows 7 and we are running SQL Server 2008 R2.

Here is my Ruby setup.

C:\Ruby\bin>gem list

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-sqlserver-adapter (2.3.4)
activeresource (2.3.5)
activesupport (2.3.5)
dbd-odbc (0.2.5)
dbi (0.4.3)
deprecated (2.0.1)
fxri (0.3.6)
fxruby (1.6.16)
hpricot (0.6.164)
log4r (1.0.5)
ptools (1.1.6)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7, 0.8.1)
ruby-opengl (0.60.0)
test-unit (2.0.1)
win32-api (1.2.1, 1.2.0)
win32-clipboard (0.4.4)
win32-dir (0.3.2)
win32-eventlog (0.5.0)
win32-file (0.5.5)
win32-file-stat (1.3.1)
win32-process (0.5.9)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.4)
windows-pr (0.9.3)

C:\Ruby\bin>

I have a very simple connect script with the following lines.

require "dbi"
conn = DBI.connect('DBI:ODBC:BRIDGE_CC', 'XXX\XXXX', 'XXXX')


I get the following error when this command is executed.

C:/Ruby/lib/ruby/site_ruby/1.8/DBD/ODBC/ODBC.rb:95:in `connect': IM014 (0) [Micr
osoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch
between the Driver and Application (DBI::DatabaseError)
from C:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:448:in `connect'
from C:/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:221:in `connect'
from C:/Data Syncronisation/Test Framework/FrameworkSetUp.rb:55

I have a BRIDGE_CC setup in my 'System DSN' tab in ODBC Data Source Administrator application.

I dont think I need to install ruby on rails since I am not writing any application per se. I want to use Ruby for
our data driven testing.

Any help would be greatly appreciated.


Thread View

Thread Author Date
Connect Ruby to SQL Server 2008 R2Chris Cropley2010-03-30 15:54
      RE: Connect Ruby to SQL Server 2008 R2Erik Hollensbe2010-03-30 16:03
            RE: Connect Ruby to SQL Server 2008 R2Chris Cropley2010-03-30 20:35
                  RE: Connect Ruby to SQL Server 2008 R2Chris Cropley2010-04-01 08:22

Post a followup to this message