I’m on Mac OS X 10.7.3 “Lion” and want to develop a Ruby on Rails 3.2.2 application using a MS SQL Server 2008 database. To do this I needed to install the activerecord-sqlserver-adapter which requires TinyTDS. While the gem install activerecord-sqlserver-adapter
worked fine, the gem install tiny_tds
failed to compile. It required a freetds
component.
This took me a while and I ended up having to install Homebrew to get it to work. Here are the steps I took to get this working, hopefully it’ll save others the hour or so I spent trying to get it working.
- Install Homebrew Package Manager by using these instructions
- Install the FreeTDS component
brew install freetds
- Install the TinyTDS gem
gem install tiny_tds -- --with-freetds-include=/usr/local/include --with-freetds-lib=/usr/local/lib --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib
- Now install the SQL Server ActiveRecord gem
gem install activerecord-sqlserver-adapter
You’ll need to then setup your database.yml file accordingly:
development: adapter: sqlserver host: 10.1.1.100 database: mydb usernane: user password: s3cr3t
2 comments:
This got my tiny_tds installed. Thank you!
Scoured Google and this finally worked, thanks!
Post a Comment