Setting up Rails to work with sqlserver Setting up Rails to work with sqlserver windows windows

Setting up Rails to work with sqlserver


I ran into the same problem yesterday. Apparently 'deprecated' is a gem, so you want to run "gem install deprecated" to grab and install the latest version. Good luck.


I used and ODBC data source and the SQL Server adapter on Windows Server 2008 against SQL Server 2000 running on a remote instance.

Install SQL Server Adapter

gem.bat install activerecord-sqlserver-adapter  Successfully installed deprecated-2.0.1  Successfully installed dbi-0.4.1  Successfully installed dbd-odbc-0.2.4  Successfully installed activerecord-sqlserver-adapter-2.2.22  4 gems installed

Create an ODBC datasource

  • Type: SQL Server
  • Name: rails_development
  • Description: rails_development
  • Server: SERVER
  • SQL Authentication (sa/12345)
  • Default Database: DATABASE

Setup database.yml

development:    adapter: sqlserver    mode: odbc    dsn: rails_development    username: sa    password: 12345

YMMV

A couple of helpful links:


Did you install the SQL Server adapter?

gem install activerecord-sqlserver-adapter --source=http://gems.rubyonrails.org