Error while installing oci8 gem for my ruby-3.0.1

35 views Asked by At

While installing oci-8 for my Ubuntu system (22.04 lts). I have tried installing libdev library and some other libraries but issue remains same.

It says that it can find the instaclient in the given LD LIBRARY PATH path but the installation still crashes.

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

    current directory: /home/sanchit/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/ruby-oci8-2.2.12/ext/oci8
/home/sanchit/.rbenv/versions/3.0.1/bin/ruby -I /home/sanchit/.rbenv/versions/3.0.1/lib/ruby/3.0.0 -r ./siteconf20240205-19908-h8sb3w.rb extconf.rb
attempting to locate oracle-instantclient...
checking load library path... 
  LD_LIBRARY_PATH... 
    checking /opt/oracle/instantclient_19_17... yes
  /opt/oracle/instantclient_19_17/libclntsh.so.19.1 looks like an instant client.
checking for cc... ok
checking for gcc... yes
checking for LP64... yes
checking for sys/types.h... yes
checking for ruby header... ok
checking for OCIEnvCreate() in oci.h... yes
checking for OCI_MAJOR_VERSION in oci.h... 19
checking for OCI_MINOR_VERSION in oci.h... 17
checking for localtime_r()... yes
checking for dladdr()... yes
checking for dlmodinfo()... no
checking for dlgetname()... no
checking for ruby/thread.h... yes
checking for rb_class_superclass() in ruby.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_sym2str() in ruby.h... yes
checking for plthook... plthook_elf.c
creating extconf.h
*** 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:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/home/sanchit/.rbenv/versions/3.0.1/bin/$(RUBY_BASE_NAME)
    --with-instant-client
    --without-instant-client
    --with-instant-client-dir
    --without-instant-client-dir
    --with-instant-client-include
    --without-instant-client-include=${instant-client-dir}/include
    --with-instant-client-lib
    --without-instant-client-lib=${instant-client-dir}/lib
    --with-sys-dir
    --without-sys-dir
    --with-sys-include
    --without-sys-include=${sys-dir}/include
    --with-sys-lib
    --without-sys-lib=${sys-dir}/lib
    --with-oracle-version
    --without-oracle-version
    --with-runtime-check
    --without-runtime-check
    --with-ruby-dir
    --without-ruby-dir
    --with-ruby-include
    --without-ruby-include=${ruby-dir}/include
    --with-ruby-lib
    --without-ruby-lib=${ruby-dir}/lib
    --with-oracle-version
    --without-oracle-version
    --with-runtime-check
    --without-runtime-check
/home/sanchit/.rbenv/versions/3.0.1/lib/ruby/3.0.0/psych.rb:456:in `parse_stream': undefined method `parse' for #<Psych::Parser:0x0000559d28a5cb28 @handler=#<Psych::Handlers::DocumentStream:0x0000559d28a5d230 @stack=[], @last=nil, @root=nil, @start_line=nil, @start_column=nil, @end_line=nil, @end_column=nil, @block=#<Proc:0x0000559d28a5cc18 /home/sanchit/.rbenv/versions/3.0.1/lib/ruby/3.0.0/psych.rb:390>>, @external_encoding=0> (NoMethodError)
    from /home/sanchit/.rbenv/versions/3.0.1/lib/ruby/3.0.0/psych.rb:390:in `parse'
    from /home/sanchit/.rbenv/versions/3.0.1/lib/ruby/3.0.0/psych.rb:280:in `load'
    from /home/sanchit/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/ruby-oci8-2.2.12/ext/oci8/apiwrap.rb:64:in `create_apiwrap'
    from extconf.rb:201:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/sanchit/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions/x86_64-linux/3.0.0/ruby-oci8-2.2.12/mkmf.log


extconf failed, exit code 1

Gem files will remain installed in /home/sanchit/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/ruby-oci8-2.2.12 for inspection.
Results logged to /home/sanchit/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions/x86_64-
linux/3.0.0/ruby-oci8-2.2.12/gem_make.out

I am Running Ruby - 3.0.1
oci-instaclient version 19_17

0

There are 0 answers