kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

Install fails with Oracle XE in custom path on Linux #124

Closed jayvdb closed 3 years ago

jayvdb commented 8 years ago

When I install Oracle XE in a custom path on Linux , the installation process finds the right library and oci.h, but then fails to find OCIEnvCreate() in oci.h.

$ bundle install --jobs=3 --retry=3
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Installing diff-lcs 1.2.5
Installing rake 11.1.2
Installing rspec-support 3.4.1
Using bundler 1.7.6
Installing rspec-core 3.4.4

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    /home/travis/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20160329-6195-fbqueb.rb extconf.rb 
checking for load library path... 
  LD_LIBRARY_PATH... 
    checking /home/travis/u01/app/oracle/product/11.2.0/xe/lib... yes
  /home/travis/u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1 looks like a full client.
checking for cc... ok
checking for gcc... yes
checking for LP64... yes
checking for sys/types.h... yes
checking for ruby header... ok
Get the version of Oracle from SQL*Plus... 1120
try  -I/home/travis/u01/app/oracle/product/11.2.0/xe/rdbms/public
checking for oci.h... yes
checking for OCIEnvCreate() in oci.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

I dont play with ruby much, so any help debugging greatly appreciated.

The way I am installing Oracle XE in a custom path can be seen here:

https://github.com/cbandy/travis-oracle/pull/9/commits/b1a30527351e3f3c1f233e101ce7da6d03ca5d6a

Build at

https://travis-ci.org/jayvdb/travis-oracle/builds/119129236 (the failed job is the one using the custom path)

kubo commented 8 years ago

Could you post the last 100 lines of mkmf.log?

In https://s3.amazonaws.com/archive.travis-ci.org/jobs/119129239/log.txt

Results logged to /home/travis/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-linux/1.9.1/ruby-oci8-2.2.1/gem_make.out

mkmf.log will be found in the directory where gem_make.out was logged to.

kubo commented 8 years ago

@jayvdb Could you check whether the symbolic link /home/travis/u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so is valid? It must point to /home/travis/u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1.

jayvdb commented 8 years ago

Awesome @kubo , that worked! https://travis-ci.org/jayvdb/travis-oracle/jobs/124447260

I'll now work on tidying it up a bit.

Perhaps it would be useful for ruby-oci8 to check for libclntsh.so, but I can appreciate it is not common for people to be trying to bypass the rpm install scripts and avoid as many steps as possible to install it without root on a container .. ;-)

Feel free to close this issue if you feel it isnt beneficial.