This is the operation procedure in Ubuntu. It will be different in other Linux systems, and the principle is similar in general. Upload 1 download ruby-oci8's latest stable version of ruby-oci8-1.0.2.tar.gz 2 install Oracle-xe-client3 first install ruby3 set environment variables, you can set in/etc/environment, you can also set in ~ /. ORACLE_HOME = "/usr/lib/oracle in bashrc
This is the operation procedure in Ubuntu. It will be different in other Linux systems, and the principle is similar in general.
Preparation
1 download ruby-oci8's latest stable version ruby-oci8-1.0.2.tar.gz
2 install Oracle-xe-client first
3 install ruby first
3. Set environment variables in/etc/environment or ~ /. Bashrc
ORACLE_HOME = "/usr/lib/oracle/xe/app/oracle/product/10.2.0/client"
LD_LIBRARY_PATH = "$ ORACLE_HOME/lib: $ LD_LIBRARY_PATH"
Note: It seems that LD_LIBRARY_PATH is not set as long as there is oracle-home.
Compile and install
Cd [Download Directory]
Tar-zxvf ruby-oci8-1.0.2.tar.gz
Cd ruby-oci8-1.0.2
Make
Make install
Test
Connect to oracle
Ruby-r oci8-e "OCI8.new ('Scott ', 'tiger', 'xe'cmd.exe c ('select sysdate from dual') do | r | puts r. join (','); end"
Change scott, tiger, and xe to your username, password, and connection Instance name, similar to sqlplus scott/tiger @ xe;