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:


development:
adapter: sqlserver
mode: odbc
dsn: DRIVER=/opt/local/lib/libtdsodbc.so;TDS_Version=8.0;SERVER=10.0.6.20;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.
4 comments

Popular posts from this blog