Rails + SQL Server 2000 on Windows XP

Obviously they are not a perfect match, but somehow I need to get this done. I did this on Windows XP with SQL Server 2000 (PE) Service Pack 4.

  1. Install Ruby 1.9.2-p0
  2. Install DevKit
  3. Install rails gem install --version 2.3.9 rails
  4. Install ruby-odbc gem install ruby-odbc --platform=ruby
  5. Install activerecord-sqlserver-adapter gem install --version 2.3.10 activerecord-sqlserver-adapter
  6. Create an ODBC data source
  7. In config\database.yml,

adapter: sqlserver mode: odbc dsn: your_dsn_name host: localhost username: sa password: your_password database: your_database encoding: utf8

Bonus

If you wish to add some custom gem configuration , you should create .gemrc file in your home directory, mine is C:\Documents and Settings\username.