| title | Step 1: Configure development environment for Ruby |
|---|---|
| description | Step 1 of this getting started guide involves installing Ruby and an ODBC driver for SQL Server into your development environment. |
| author | David-Engel |
| ms.author | davidengel |
| ms.date | 03/25/2026 |
| ms.service | sql |
| ms.subservice | connectivity |
| ms.custom | linux-related-content |
| ms.topic | how-to |
Configure your development environment with the prerequisites to develop an application by using the Ruby Driver for SQL Server.
The Ruby Driver uses the TDS protocol, which is enabled by default in SQL Server and Azure SQL Database. No additional configuration is required.
-
Download Ruby Installer If your machine doesn't have Ruby, install it. Go to the Ruby download page and download the latest Ruby+Devkit installer for your architecture (x64 or x86). For example, download Ruby+Devkit 3.2.x (x64).
-
Install Ruby Run the installer:
- Select your language, and agree to the terms.
- On the install settings screen, select the check boxes next to both Add Ruby executables to your PATH and Associate
.rband.rbwfiles with this Ruby installation. - After installation, the MSYS2 setup dialog appears. Select option 3 (MSYS2 and MINGW development toolchain) and press Enter to install the build tools.
-
Open a new command prompt
-
Install TinyTDS gem
gem install tiny_tds
Note
Previous versions of Ruby (2.x) required a separate DevKit download and dk.rb init / dk.rb install commands. Ruby 3.0 and later versions include the MSYS2 DevKit in the installer, so separate DevKit setup is no longer required.
-
Open terminal
-
Install Ruby and prerequisites
sudo apt-get update sudo apt-get install -y ruby-full build-essential
-
Verify Ruby installation
ruby -v
-
Install FreeTDS
sudo apt-get install -y freetds-dev freetds-bin
-
Install TinyTDS
gem install tiny_tds
macOS includes a system Ruby installation, but for best results, install a current version by using Homebrew.
-
Open terminal
-
Install Homebrew package manager
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install Ruby (optional, if you need a newer version than the system Ruby)
brew install ruby
-
Install FreeTDS
brew install FreeTDS
-
Install TinyTDS gem
gem install tiny_tds