我的主數據庫是本地mysql數據庫,但是我想偶爾直接在我的應用程序代碼中連接到Oracle數據庫。Ruby on Rails Oracle數據庫連接
oracle數據庫位於另一個RHEL服務器上。
我unsuccessfull嘗試安裝紅寶石OCI8寶石(錯誤:未能建立寶石原生擴展)
我想知道oracle數據庫是否是爲了使用這個寶石,或者如果本地有更好的方法來實現這一點。
gem install ruby-oci8
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for load library path...
LD_LIBRARY_PATH...
checking /opt/instantclient... yes
/opt/instantclient/libclntsh.so.11.1 looks like an instant client.
checking for cc... *** 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=/usr/bin/ruby
--with-instant-client
--without-instant-client
./oraconf.rb:562:in `check_cc': RuntimeError (RuntimeError)
from ./oraconf.rb:549:in `init'
from ./oraconf.rb:1001:in `initialize'
from ./oraconf.rb:343:in `new'
from ./oraconf.rb:343:in `get'
from 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
我檢查了mkmf.log文件:
"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 for -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 */
這已經離開了我最初的問題的整個點。我想知道OCI8插件是否適用於外部數據庫,因爲我似乎無法在任何地方放置主機名 – Rumpleteaser 2010-12-22 05:19:37
「C編譯器無法正常工作。」似乎看起來像一個問題。我嘗試下載源代碼並製作它。 – Rumpleteaser 2010-12-22 05:53:17