Installing activerecord-oracle_enhanced-adapter in a Docker container

Skip to first unread message

Serguei Cambour

Jul 11, 2018, 8:28:57 AM7/11/18
to Oracle enhanced adapter for ActiveRecord
Are there any special steps to follow (I didn't find any in README) when installing activerecord-oracle_enhanced-adapter gem in a Docker container ?
I added theses 2 gems to Gemfile of the app:

  gem 'activerecord-oracle_enhanced-adapter', '~> 5.2.0'

and everything was installed fine on macOS.

But when running bundle install fro inside the Docker container the same app is packed to, it failed:

Fetching rspec-mocks 3.7.0

Installing rspec-mocks 3.7.0

Fetching rspec-rails 3.7.2

Installing rspec-rails 3.7.2

Fetching ruby-oci8

Installing ruby-oci8 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/bundle/gems/ruby-oci8-

/usr/local/bin/ruby -r ./siteconf20180711-7-11cf4dv.rb extconf.rb

checking for load library path... 

  LD_LIBRARY_PATH is not set.

  checking no

checking for cc... ok

checking for gcc... yes

checking for LP64... yes

checking for sys/types.h... yes

checking for ruby header... ok

*** 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.

Provided configuration options:














/usr/local/bundle/gems/ruby-oci8- `get_home':

RuntimeError (RuntimeError)

from /usr/local/bundle/gems/ruby-oci8-


from /usr/local/bundle/gems/ruby-oci8- `new'

from /usr/local/bundle/gems/ruby-oci8- `get'

from extconf.rb:22:in `<main>'


Error Message:

  Set the environment variable ORACLE_HOME if Oracle Full Client.

Append the path of Oracle client libraries to LD_LIBRARY_PATH if Oracle

Instant Client.



  /usr/local/bundle/gems/ruby-oci8- `get_home'



  /usr/local/bundle/gems/ruby-oci8- `new'

  /usr/local/bundle/gems/ruby-oci8- `get'

  extconf.rb:22:in `<main>'


What's wrong here ?

Christopher Jones

Jul 11, 2018, 8:35:40 PM7/11/18
to, Serguei Cambour

From the README: "If you are using CRuby >= 1.9.3 then you need to install ruby-oci8 gem as well as Oracle client, e.g. Oracle Instant Client. "

How are you installing the Oracle client in the container?  (Or are you using Oracle's Instant Client container! )

You received this message because you are subscribed to the Google Groups "Oracle enhanced adapter for ActiveRecord" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit


Serguei Cambour

Jul 12, 2018, 3:31:48 AM7/12/18
to Oracle enhanced adapter for ActiveRecord
Yes, I found the line about the constraint to have Oracle Instant Client installed :(.
The big question is what is the right way to install it on a Linux machine, with rpm, other ways ?

Actually, what I'm trying to do is;:

- download oracle-instantclient12.2-basic-
- download  oracle-instantclient12.2-devel- (may be optional)
- download  oracle-instantclient12.2-tools- (may be optional)
- copy the above rpm files into a <RAILS_APP>/oracle folder

Then in my Dockerfile:

COPY oracle $APP_HOME/

RUN alien oracle
RUN alien oracle
RUN alien oracle

RUN dpkg
-i oracle/oracle-instantclient12.2-basic-
RUN dpkg
-i oracle/oracle-instantclient12.2-devel-
RUN dpkg
-i oracle/oracle-instantclient12.2-tools-

export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib:$LD_LIBRARY_PATH

But it still fails to run the above commands and install it. So, I'll have to dig deeper in Oracle & Linux docs to figure out how to fix that.

Serguei Cambour

Jul 12, 2018, 11:38:58 AM7/12/18
to Oracle enhanced adapter for ActiveRecord
I figured out how to make it work, see the example of a Rails app in my GitHub repo.
Reply all
Reply to author
0 new messages