Friday, July 24, 2009

Running Rails 2.3.3 on JRuby 1.3.1 with MS-SQL 2008


This document is derived from codersifu - Sudirman

We need to run Rails 2.3.3 on JRuby 1.3.1 (Java 6) in combination with MS-SQL Server 2008.
There is no activerecord-jdbc-adapter for MS SQL Server so you need to do something else.

This should work on Mac OS-X Leopard and Debian Lenny.

jruby -S gem install activerecord-jdbc-adapter

Download MS JDBC driver version 2.0 from Microsoft MSDN

After your download complete, extract sqljdbc4.jar into your jruby\lib directory.

You need to modify your database.yml. Here is the example:


development:
adapter: jdbc
username: sa
password:
driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://database-server;databaseName=trogdor_development

No comments: