Easy Way to Configure Rails ActiveRecord and SQL Server on Mac OS X

Thanks to How to Connect To Microsoft SQL Server From Rails On OSX, I found out a very easy way to configure the database connection.

Assuming you have FreeTDS installed (easily through macports) and iODBC (comes out of the box with Mac OS X) then this is all you need in your database.yml file:

adapter: sqlserver
mode: odbc
dsn: DRIVER=/opt/local/lib/libtdsodbc.so;TDS_Version=8.0;SERVER=;DATABASE=awesome_development;Port=1433;uid=sa;pwd=password;

No configuration of a DSN required, and no mucking about with freetds.conf!

Now, if I could just use database.yml to get rid of SQL Server all together, I'd be a happy developer.

Popular posts from this blog

Lists and arrays in Dart

Converting Array to List in Scala

Null-aware operators in Dart