Install for Oracle Full Client
Introduction
This page explains the way to install ruby-oci8 for Oracle Full Client installations.
For Oracle Instant Client, look at install-instant-client. For Windows, look at install-binary-package unless you have a special need to compile ruby-oci8 by yourself.
Check the environment
Oracle installation
Run the following command and confirm it works fine. If it doesn't work well, you need to ask to your database administrator.
sqlplus USERNAME/PASSWORD
ruby installation
Run the following command. If it ends with "can't find header files for ruby" or "ruby: no such file to load -- mkmf (LoadError)", you need to install ruby-devel(redhat) or ruby-dev(debian/ubuntu).
ruby -r mkmf -e ""
development tools
You need a C compiler and development tools such as make or nmake. Note that they must be same with ones used to compile the ruby. For example, you need Oracle Solaris Studio, not gcc, for ruby compiled by Oracle Solaris Studio.
Installation
If you get a problem in the following steps, look at platform-specific-issues and report-installation-issue.
Set the library search path
UNIX
Set the library search path, whose name depends on the OS, to point to $ORACLE_HOME/lib. If the database is 64-bit and the ruby is 32-bit, use $ORACLE_HOME/lib32 instead.
OS | library search path |
---|---|
Linux | LD_LIBRARY_PATH |
Solaris 32-bit ruby | LD_LIBRARY_PATH_32 or LD_LIBRARY_PATH |
Solaris 64-bit ruby | LD_LIBRARY_PATH_64 or LD_LIBRARY_PATH |
HP-UX PA-RISC 32-bit ruby | SHLIB_PATH |
HP-UX PA-RISC 64-bit ruby | LD_LIBRARY_PATH |
HP-UX IA64 | LD_LIBRARY_PATH |
Mac OS X | DYLD_LIBRARY_PATH |
AIX | LIBPATH |
Do not forget to export the variable as follows:
$ LD_LIBRARY_PATH=$ORACLE_HOME/lib
$ export LD_LIBRARY_PATH
Windows(mswin32, mingw32, cygwin)
If sqlplus runs correctly, library search path has no problem.
gem package
Run the following command.
gem install ruby-oci8
tar.gz package
Download the source code
Download the latest tar.gz package from download page.
Run make and install
UNIX or Windows(mingw32, cygwin)
gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf -
cd ruby-oci8-VERSION
make
make install
note: If you use 'sudo
', use it only when running 'make install
'.
'sudo
' doesn't pass library search path to the executing command for security reasons.
Windows(mswin32)
gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf -
cd ruby-oci8-VERSION
nmake
nmake install