Accessing MSSQL with Rails 2.3.2 and Ruby 1.9.1

I am having a strange issue. I have upgraded to ruby 1.9.1 to do some
testing on one of my machines. My app accesses a MSSQL database to
pull in some information. Everything worked fine with ruby 1.8.6, but
now if I try to navigate to a page that accesses that database I get
this error:

DBI::InterfaceError in PagesController#company
Unable to load driver ‘ODBC’ (underlying error: uninitialized constant
DBI::DBD::ODBC)

If I use script/console everything works fine, and it worked fine in
with ruby 1.8.6 as well. Does anyone have any ideas? I am baffled.

On Thu, Apr 2, 2009 at 1:39 PM, btomlin <> wrote:

If I use script/console everything works fine, and it worked fine in
with ruby 1.8.6 as well. Does anyone have any ideas? I am baffled.

What version of the MySQL gem you’re using with Ruby 1.9.1 and Rails
2.3.2?

-Conrad

It’s not MySQL, its MSSQL so I’m using activerecord-sqlserver-adapter
(1.0.0.9250), dbd-odbc (0.2.4), and dbi (0.4.1)

Cosimo G. wrote:

btomlin wrote:

It’s not MySQL, its MSSQL so I’m using activerecord-sqlserver-adapter
(1.0.0.9250), dbd-odbc (0.2.4), and dbi (0.4.1)

Yes, it looks like a newer version of ruby-odbc is needed:
ODBC Binding for Ruby

or we have just to compile it?

I’ve built of my own and work either with 191-p0-mswin32 and
191-p243-mingw32

http://files.tiscali.it/cosimo.g/My%20Files/ruby19-odbc-mswin32.zip

btomlin wrote:

It’s not MySQL, its MSSQL so I’m using activerecord-sqlserver-adapter
(1.0.0.9250), dbd-odbc (0.2.4), and dbi (0.4.1)

Yes, it looks like a newer version of ruby-odbc is needed:
http://www.ch-werner.de/rubyodbc/

or we have just to compile it?

Connecting to Microsoft SQL Server from Mac OS X

http://www.napcsweb.com/blog/2007/03/08/15/#more-15

George Hill wrote:

Cosimo G. wrote:

I’ve built of my own and work either with 191-p0-mswin32 and
191-p243-mingw32

http://files.tiscali.it/cosimo.g/My%20Files/ruby19-odbc-mswin32.zip

Any chance of making this available? I’m having the same difficulty
accessing MSSQL 2008 10.0.2531

I’m very sorry, in my mind ‘My Files’ was shared files.
Of course, the ‘web’ folder is right one to share:
http://web.tiscali.it/mamva/ruby19-odbc-mswin32.zip

Enjoy it.

Cosimo G.

Cosimo G. wrote:

Cosimo G. wrote:

btomlin wrote:

It’s not MySQL, its MSSQL so I’m using activerecord-sqlserver-adapter
(1.0.0.9250), dbd-odbc (0.2.4), and dbi (0.4.1)

Yes, it looks like a newer version of ruby-odbc is needed:
ODBC Binding for Ruby

or we have just to compile it?

I’ve built of my own and work either with 191-p0-mswin32 and
191-p243-mingw32

http://files.tiscali.it/cosimo.g/My%20Files/ruby19-odbc-mswin32.zip

Any chance of making this available? I’m having the same difficulty
accessing MSSQL 2008 10.0.2531

Cosimo G. wrote:

George Hill wrote:

Cosimo G. wrote:

I’ve built of my own and work either with 191-p0-mswin32 and
191-p243-mingw32

http://files.tiscali.it/cosimo.g/My%20Files/ruby19-odbc-mswin32.zip

Any chance of making this available? I’m having the same difficulty
accessing MSSQL 2008 10.0.2531

I’m very sorry, in my mind ‘My Files’ was shared files.
Of course, the ‘web’ folder is right one to share:
http://web.tiscali.it/mamva/ruby19-odbc-mswin32.zip

Enjoy it.

Cosimo G.

Fantastic! I copied these two files to
Ruby19\lib\ruby\1.9.1\i386-mingw32 and now its all working perfectly.
Thank you very much. George.