Platform Specific Issues
Mac OS X
You need to delete '-arch ppc' or '-arch i386' in rbconfig.rb because the ruby distributed with Mac is universal binary but the Oracle instant client is not. See: How to setup Ruby and new Oracle Instant Client on Leopard. (PowerPC mac users need to swap ppc and i386 in the blog.)
The Intel Instant client is for Mac OS X 10.5 Leopard. If you are using 10.4 Tiger, use one of the following workarounds.
- compile ruby as ppc. (look at How to setup Ruby and Oracle client on Intel Mac)
- use ruby-odbc and a third party ODBC driver (Actual Technologies or OpenLink Software).
- use JRuby and Oracle JDBC driver.
Solaris
You need a same compiler which is used to make ruby itself.
There are two ruby packages.
The former is compiled by gcc. The latter is compiled by Sun Studio. The both compilers are freely available.
If you use Blastwave.org's ruby and want not to install Sun Studio, you can edit rbconfig.rb by your self. (look at here)
Linux
Use the same bit-width of libraries with ruby. For example, x86_64 instant client for x86_64 ruby and 32-bit instant client for 32-bit ruby. It depends on the ruby but not on the OS. As for full client, x86_64 ruby cannot use with 32-bit full client, but 32-bit ruby can use with 64-bit full client because 32-bit libraries are in $ORACLE_HOME/lib32.
To check which type of ruby do you use:
file `which ruby`
note: ` is a back quote.
FreeBSD
There are two ways.
- use ruby and instant client on linux emulator
- use oracle8-client port
I don't recommend the latter because of the following two reasons.
- The oracle8-client port is made from Oracle 8.1.7.1 static library for Linux. Oracle have not supported the connectivity between 8.1.7.1 and Oracle 10g.
- It is very unstable. When it fails to connect to an Oracle server, it is down by segmentation fault on FreeBSD 7.0 not only when using ruby-oci8, but also by a very simple test code written by C.
1. use ruby and instant client on linux emulator
I have not run ruby-oci8 on linux emulator, but I guess it will run as follows. If it works, please tell me.
If FreeBSD has a cross-compiler which can generate linux binaries, use it to compile ruby and ruby-oci8.
If FreeBSD doesn't have such a compiler, install a linux distribution which FreeBSD can emulate to a PC machine, make ruby and ruby-oci8 in the linux box and copy them to the FreeBSD box as follows.
on linux
# make ruby
tar xvfz ruby-1.8.x.tar.gz
cd ruby-1.8.x
./configure --prefix=/usr/local/ruby-1.8.x --enable-pthread
make
make install
# setup instant client
....
# make ruby-oci8
PATH=/usr/local/ruby-1.8.x/bin:$PATH
tar xvfz ruby-oci8-1.0.x.tar.gz
cd ruby-oci8-1.0.x
make
make install
cd /usr/local/
tar cvfz ruby-1.8.x-linux.tar.gz ruby-1.8.x
copy ruby-1.8.x-linux.tar.gz to the FreeBSD box.
on freebsd
cd /compat/linux/usr/local
tar xvfz ruby-1.8.x-linux.tar.gz
2. use oracle8-client port
If you try to use oracle8-client port, compile and install as follows.
- install oracle8-client
cd /usr/ports/databases/oracle8-client make make install
- set an environment variable ORACLE_HOME
export ORACLE_HOME=/usr/local/oracle8-client
The rest procedures are described at this page.
note: You have no need to set LD_LIBRARY_PATH because Oracle libraries in oracle8-client port are static ones.
HP-UX
You need a ruby which is linked with libpthread and libcl.
Look at http://www.alfonsomartone.itb.it/xvpucf.html for more detail.
Windows
On some machines whose disk I/O is busy or which uses a slow disk, you may get a following error.
Permission denied - conftest.exe
Edit mkmf.rb for a workaround.
def try_run(src, opt="")
if try_link0(src, opt)
xsystem("./conftest")
else
nil
end
ensure
# add the following one line.
sleep 1 if /mswin32|cygwin|mingw32|bccwin32/ =~ RUBYPLATFORM
rm_f "conftest*"
end
See also: http://abstractplain.net/blog/?p=788.
Keyword(s):
References:[SideMenu] [Report Install Problem]