- Install the jTDS JDBC Driver. For your convenience, DO packages it as a Ruby
Gem. If installing from source,
cd
to../jdbc_drivers/sqlserver/
and runrake install
. - There are currently no other prerequisites for installation.
-
Install the DBI and DBD::ODBC dependencies:
sudo gem install dbi sudo gem install dbd-odbc
-
Install ODBC Binding for Ruby. It it not currently available via RubyGems, so you'll have to download the source tarball:
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz tar xvfz ruby-odbc-0.9997.tar.gz cd ruby-odbc-0.9997
-
Ensure you read the accompanying
COPYING
file, as the ODBC Binding for Ruby is licensed under the GPL, unlike DataObjects. To install read the accompanyingINSTALL
file. On a recent variant of OS X, installation should look like this:ruby extconf.rb make sudo make install
-
You must also have FreeTDS or unixODBC (SQL Server license for unixODBC is commercially licensed though) installed.
-
To install FreeTDS on OS X, you can use MacPorts:
sudo port install freetds
Configuration file freetds.conf does not exist and has been created using /opt/local/etc/freetds/freetds.conf.sample Configuration file locales.conf does not exist and has been created using /opt/local/etc/freetds/locales.conf.sample Configuration file pool.conf does not exist and has been created using /opt/local/etc/freetds/pool.conf.sample
-
Then edit your ODBC configuration and add the FreeTDS driver.
-
Using a text editor: On OS X, open
/Library/ODBC/odbcinst.ini
and add the following entries:[FreeTDS] Driver = /opt/local/lib/libtdsodbc.so Setup = /opt/local/lib/libtdsodbc.so
-
You can also use a GUI for this (provided in Mac OS X 10.3 - 10.5; ODBCManager available for OS X 10.6)..
- Start ODBC Manager
- Go to Drivers, Add...
- Enter FreeTDS as Driver Name.
- Enter
/usr/local/freetds/lib/libtdsodbc.so
as Driver File - Enter
/usr/local/freetds/lib/libtdsodbc.so
as Setup File - Select System
- Click OK.
-