Error installing ruby-oci8 on ubuntu 14.04 x64

1.5k Views Asked by At

I'm using ubuntu 14.04 x64 with the following environment variables:

export ORACLE_HOME=/usr/lib/oracle/12.1/client64
export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
export PATH=$ORACLE_HOME/bin:$PATH

The Sqlplus works fine!

But when i try install the ruby-oci8 gem, the system returns me the error below:

bundle exec gem install ruby-oci8 --backtrace
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-oci8:
    ERROR: Failed to build gem native extension.

    /opt/rbenv/versions/2.1.2/bin/ruby extconf.rb
/opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find ruby-oci8-2.1.7 in any of the sources (Bundler::GemNotFound)
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/spec_set.rb:85:in `map!'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/spec_set.rb:85:in `materialize'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/definition.rb:132:in `specs'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/definition.rb:177:in `specs_for'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/definition.rb:166:in `requested_specs'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/environment.rb:18:in `requested_specs'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:13:in `setup'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler.rb:121:in `setup'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/setup.rb:17:in `<top (required)>'
    from /opt/rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

extconf failed, exit code 1

Gem files will remain installed in /u/apps/poseidon_kco_production/shared/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.7 for inspection.
Results logged to /u/apps/poseidon_kco_production/shared/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/ruby-oci8-2.1.7/gem_make.out

Anyone know what could be happening?

1

There are 1 best solutions below

0
On BEST ANSWER

I remember I had a similar issue with ruby-oci8 about 2 years ago and it's because ruby-oci8 somehow didn't work with 64 bit architecture. My solution was to use ruby 32bit instead of 64bit.

Did you follow this: http://www.rubydoc.info/gems/ruby-oci8/file/docs/install-instant-client.md

Using Oracle with ruby is a pain, been there done that :-).

Just to be clearer, What I did was:

  1. Download oracle instant client 32bit
  2. Use ruby 32bit or x86_64 to install ruby-oci8