Featured post
Ruby on Rails Oracle DB connection -
my main database local mysql database, connect oracle database directly in applications code.
the oracle database hosted on rhel server.
i unsuccessfull tried install ruby-oci8 gem (error: failed build gem native extension.)
i wondering whether oracle database has local in order use gem, or if there better ways of achieving this.
gem install ruby-oci8 building native extensions. take while... error: error installing ruby-oci8: error: failed build gem native extension. /usr/bin/ruby extconf.rb checking load library path... ld_library_path... checking /opt/instantclient... yes /opt/instantclient/libclntsh.so.11.1 looks instant client. checking cc... *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. 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=/usr/bin/ruby --with-instant-client --without-instant-client ./oraconf.rb:562:in `check_cc': runtimeerror (runtimeerror) ./oraconf.rb:549:in `init' ./oraconf.rb:1001:in `initialize' ./oraconf.rb:343:in `new' ./oraconf.rb:343:in `get' extconf.rb:18 ng --------------------------------------------------- error message: c compiler doesn't work correctly. backtrace: ./oraconf.rb:562:in `check_cc' ./oraconf.rb:549:in `init' ./oraconf.rb:1001:in `initialize' ./oraconf.rb:343:in `new' ./oraconf.rb:343:in `get' extconf.rb:18 --------------------------------------------------- see: * http://ruby-oci8.rubyforge.org/en/howtoinstall.html * http://ruby-oci8.rubyforge.org/en/reportinstallproblem.html
i checked mkmf.log file:
"gcc -o conftest -i. -i/usr/lib64/ruby/1.8/x86_64-linux -i. -o2 -g -pipe -wall -wp,-d_fortify_source=2 -fexceptions -fs tack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fpic conftest.c -l. -l/usr/lib64 -l. -rdynamic -wl,-export-dynamic -lruby-static -lpthread -lrt -ldl -lcrypt -lm -lc" /usr/bin/ld: skipping incompatible /usr/lib/libruby-static.a when searching -lruby-static /usr/bin/ld: cannot find -lruby-static collect2: ld returned 1 exit status checked program was: /* begin */ 1: int main() { return 0; } 8 /* end */
at first need install oracle instant client - choose corresponding linux 32-bit or 64-bit binaries. safe use older version 10.2.0.4 use in ruby , oracle projects. install basic, sdk , sql*plus packages.
then include oracle instant client installation directory in ld_library_path environment variable oracle instant client dynamic libraries in load path.
then try install ruby-oci8 gem.
afterwards install activerecord-oracle_enhanced-adapter gem able access oracle database activerecord.
i have posted instructions how install ruby-oci8 on mac os x - majority of applies linux (dyld_library_path on mac corresponds ld_library_path on linux).
in addition have created sprinkle recipe automated oracle client installation on linux - not best way start in case want build automated server installation scripts can take on it.
- Get link
- X
- Other Apps
Comments
Post a Comment