How to Compile Ruby ODBC for Ubuntu
The ODBC bindings for the Ruby programming language provide a method for accessing Open Database Connections. Once installed, the module can be used to access any open database including MySQL and SQLite. The source code is available from the developer's website and can be compiled on any Linux operating system, including Ubuntu Linux. You must have the Ruby 1.7 or above and unixODBC 2.x or libiodbc 3.52 packages installed before compiling the ODBC module.
Instructions
-
-
1
Download the source code file from the ODBC Binding for Ruby website.
-
2
Right-click on the desktop and click on the "Open in Terminal" option.
-
-
3
Navigate to the directory where the ruby-odbc tar file is stored.
-
4
Type the following command to extract the contents of the file:
tar -xvzf ruby-odbc-<version>.tar.gz
Replace "<version>" with the version number of the file you downloaded.
-
5
Type the following command to navigate into the newly extracted directory:
cd ruby-odbc-<version>
-
6
Type the following command to configure the package:
ruby -Cext extconf.rb [--enable-dlopen|--disable-dlopen]
Choose either "--enable-dlopen" or "--disable-dlopen", depending on whether you want the software to know about the unixODBC/iODBC driver.
-
7
Type the following three commands to install the software:
make -C ext
su-
make -C ext install
-
1
Tips & Warnings
You can also install Ruby ODBC from the Ubuntu software repository using the "sudo apt-get install libdbd-odbc-ruby" command.