Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Setup OS X 10.6.4 w/ homebrew, rvm, rails, unixodbc, freetds and SQL Server

Setup new mac from scratch

These commands are good as of 2010-11-18.


/usr/bin/ruby -e "$(/usr/bin/curl -fsSL"

Install xcode (download, or on the OS X install DVD)



brew install git


brew install svn


curl -L | bash -s stable

Configure ~/.gemrc

# Add this line to the top
gem --no-ri --no-rdoc

Unixodbc / freetds

brew install unixodbc # 2.3.1
brew install freetds --with-unixodbc # 0.91. Specify --with-unixodbc, otherwise it uses iODBC which has problems with some data types

Install ruby and gems

rvm install ruby-1.9.3
gem install bundler
gem install rails
gem install tiny_tds # >= 0.5.1
gem install activerecord-sqlserver-adapter

Below is only needed if you are NOT using tiny_tds for you database connection (you should be!)


gem install ruby-odbc # 0.99992. Note: not needed if you use tiny_tds

/usr/local/etc/freetds.conf, symlinked from homebrew (brew info freetds)

host =
port = 1433
tds version = 8.0
client charset = UTF-8

/usr/local/etc/odbcinst.ini, symlinked from homebrew (brew info unixodbc)

Description = TD Driver (MSSQL)
Driver = /usr/local/lib/
Setup = /usr/local/lib/
FileUsage = 1

/usr/local/etc/odbc.ini, symlinked from homebrew (brew info unixodbc)

Description = YourDSN
Driver = FreeTDS
Database = some_database
Servername = your_server_name # from freetds.conf
Server = your_server_name # from freetds.conf
Port = 1433
Client charset = UTF-8

I am not sure how these commands can be good. The driver that you're pointing to is a .so file, and Mac uses .dylib files. Those files can't actually exist there, unless you somehow forced them there. If so, can you explain those steps?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment