Skip to content

Instantly share code, notes, and snippets.

@ilpeste
Created October 25, 2011 10:50
Show Gist options
  • Save ilpeste/1312271 to your computer and use it in GitHub Desktop.
Save ilpeste/1312271 to your computer and use it in GitHub Desktop.
Errors while installing ruby-oci8 on Ubuntu 11.10
# Natty (Ubuntu 11.04)
$ dpkg -L libc6-dev | grep /types.h
/usr/include/bits/types.h
/usr/include/rpc/types.h
/usr/include/sys/types.h
# Oneiric (Ubuntu 11.10)
$ dpkg -L libc6-dev | grep /types.h
/usr/include/rpc/types.h
/usr/include/x86_64-linux-gnu/bits/types.h
/usr/include/x86_64-linux-gnu/sys/types.h
$ gem install 'ruby-oci8'
Installing ruby-oci8 (2.0.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for load library path...
LD_LIBRARY_PATH...
checking /opt/oracle/instantclient_11_2... yes
/opt/oracle/instantclient_11_2/libclntsh.so.11.1 looks like an instant client.
checking for cc... ok
checking for gcc... yes
checking for LP64... no
checking for ruby header... *** 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/matteo/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
--with-instant-client
--without-instant-client
/home/user/.rvm/gems/ruby-1.9.2-p290@moduli/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:647:in `check_ruby_header': RuntimeError (RuntimeError)
from /home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:581:in `init'
from /home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:1030:in `initialize'
from /home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:343:in `new'
from /home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:343:in `get'
from extconf.rb:18:in `<main>'
---------------------------------------------------
Error Message:
Do you install glibc-devel(redhat) or libc6-dev(debian)?
You need /usr/include/sys/types.h to compile ruby-oci8.
Backtrace:
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:647:in `check_ruby_header'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:581:in `init'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:1030:in `initialize'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:343:in `new'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/oraconf.rb:343:in `get'
extconf.rb:18:in `<main>'
---------------------------------------------------
See:
* http://ruby-oci8.rubyforge.org/en/HowToInstall.html
* http://ruby-oci8.rubyforge.org/en/ReportInstallProblem.html
Gem files will remain installed in /home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6 for inspection.
Results logged to /home/user/.rvm/gems/ruby-1.9.2-p290/gems/ruby-oci8-2.0.6/ext/oci8/gem_make.out
An error occured while installing ruby-oci8 (2.0.6), and Bundler cannot continue.
Make sure that `gem install ruby-oci8 -v '2.0.6'` succeeds before bundling.
$ sudo ln -s /usr/include/i386-linux-gnu/sys /usr/include/sys
@jmervine
Copy link

For me (Ubuntu 12.04.2 LTS) the following worked:

mkdir -p /usr/include/sys && ln -s /usr/include/linux/types.h /usr/include/sys/types.h

@sunaku
Copy link

sunaku commented Jul 23, 2013

+1 for @jmervine's solution: it also worked under 64-bit Ubuntu 12.10 for me. ✨

@sandrods
Copy link

+1 for @jmervine's solution under 64-bit Ubuntu 16.04 for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment