为我的 Ubuntu 系统(22.04 lts)安装 oci-8 时。我尝试安装 libdev 库和其他一些库,但问题仍然相同。
它说可以在给定的 LD LIBRARY PATH 路径中找到 instaclient,但安装仍然崩溃。
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
我正在运行 Ruby - 3.0.1
oci-instaclient 版本 19_17
将
psych
降级到 3.1.0
版本对我有用
仅供参考:在使用 Homebrew 安装
tmuxinator
后,我遇到了 psych gem 的兼容性问题,然后安装并升级了我的 Ruby 和相关 gem,包括 psych
。