无法在macOS Big Sur上安装DBD :: Oracle =>找不到依赖的dylib'@ rpath / libclntsh.dylib.19.1'

总部

我无法在macOS Big Sur 11.2.1上构建和安装Oracle Instant Client 19.8我收到以下错误:

Error:  Can't load '/Users/x/.cpanm/work/1613898291.17798/DBD-Oracle-1.80/blib/arch/auto/DBD/Oracle/Oracle.bundle' for module DBD::Oracle: dlopen(/Users/x/.cpanm/work/1613898291.17798/DBD-Oracle-1.80/blib/arch/auto/DBD/Oracle/Oracle.bundle, 0x0002): dependent dylib '@rpath/libclntsh.dylib.19.1' not found for '/Users/x/.cpanm/work/1613898291.17798/DBD-Oracle-1.80/blib/arch/auto/DBD/Oracle/Oracle.bundle'. relative file paths not allowed '@rpath/libclntsh.dylib.19.1' at /System/Library/Perl/5.28/darwin-thread-multi-2level/DynaLoader.pm line 197.

看来Big Sur不会将DYLD_LIBRARY_PATH环境变量传递给子shell:

Your DYLD_LIBRARY_PATH env var is set to ''
WARNING: Your DYLD_LIBRARY_PATH env var doesn't include '/opt/instantclient_19_8' but probably needs to.

我试过了:

  • 默认路径安装~/Downloads/instantclient_19_8
  • 安装在~/lib/usr/local/lib
  • 用绝对路径替换符号链接
  • 使用install_name_tool修改ID和更改@rpath但得到了warning: changes being made to the file will invalidate the code signature

但我似乎无法弄清楚。非常感谢您的帮助。重制:

  1. Oracle Instant Client 19.8安装到/opt/instantclient_19_8

  2. macOS Big Sur,设置必要的环境变量。

% uname -v
Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64
% echo $DYLD_LIBRARY_PATH
/opt/instantclient_19_8

% env | grep -E 'PERL|ORACLE|DYLD'
PERL_LOCAL_LIB_ROOT=/Users/x/.perl5
PERL_MB_OPT=--install_base /Users/x/.perl5
PERL_MM_OPT=INSTALL_BASE=/Users/x/.perl5
PERL5LIB=/Users/x/.perl5/lib/perl5
ORACLE_HOME=/opt/instantclient_19_8

那是我在那里的第一个问题。DYLD_LIBRARY_PATH被清除。

  1. 安装cpanm到〜/ .perl5
% curl -fsSL http://cpanmin.us | perl - -l ~/.perl5 App::cpanminus local::lib
--> Working on App::cpanminus
Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz ... OK
Configuring App-cpanminus-1.7044 ... OK
Building and testing App-cpanminus-1.7044 ... OK
Successfully installed App-cpanminus-1.7044
--> Working on local::lib
Fetching http://www.cpan.org/authors/id/H/HA/HAARG/local-lib-2.000024.tar.gz ... OK
Configuring local-lib-2.000024 ... OK
Building and testing local-lib-2.000024 ... OK
Successfully installed local-lib-2.000024
2 distributions installed
  1. 强制安装DBI,以避免与内置版本发生任何冲突:
% cpanm DBI
DBI is up to date. (1.643)
% cpanm DBI --force
--> Working on DBI
Fetching http://www.cpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz ... OK
Configuring DBI-1.643 ... OK
Building and testing DBI-1.643 ... FAIL
! Testing DBI-1.643 failed but installing it anyway.
Successfully reinstalled DBI-1.643
1 distribution installed
  1. 安装DBD::Oracle-总是失败。
% cpanm DBD::Oracle
--> Working on DBD::Oracle
Fetching http://www.cpan.org/authors/id/M/MJ/MJEVANS/DBD-Oracle-1.80.tar.gz ... OK
==> Found dependencies: Test::NoWarnings
--> Working on Test::NoWarnings
Fetching http://www.cpan.org/authors/id/A/AD/ADAMK/Test-NoWarnings-1.04.tar.gz ... OK
Configuring Test-NoWarnings-1.04 ... OK
Building and testing Test-NoWarnings-1.04 ... OK
Successfully installed Test-NoWarnings-1.04
Configuring DBD-Oracle-1.80 ... OK
Building and testing DBD-Oracle-1.80 ... FAIL
! Installing DBD::Oracle failed. See /Users/x/.cpanm/work/1613898291.17798/build.log for details. Retry with --force to force install it.
1 distribution installed
HåkonHægland

问题是,在DYLD_LIBRARY_PATH运行时环境变量不会传播到perl的make test描述在这里除了运行外cpanm DBD::Oracle,您还可以下载模块,例如使用手动运行测试prove以下代码适用于我(macOS BigSur 11.2.1),perlbrew perl版本5.32.0:

  • 下载并安装instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg,并instantclient-sdk-macos.x64-19.8.0.0.0dbru.dmghttps://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html

  • 安装DBD::Oracle(不运行make test

    $ wget https://cpan.metacpan.org/authors/id/M/MJ/MJEVANS/DBD-Oracle-1.80.tar.gz
    $ tar zxvf DBD-Oracle-1.80.tar.gz
    $ cd DBD-Oracle-1.80
    $ export DYLD_LIBRARY_PATH=/Users/hakonhaegland/Downloads/instantclient_19_8
    $ export ORACLE_HOME=/Users/hakonhaegland/Downloads/instantclient_19_8
    $ cpanm --installdeps .
    $ perl Makefile.PL
    $ make
    $ prove -bv t  
    $ make install
    

笔记:

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用“ /usr/lib/libcrypto.dylib”在MacOS 10.15 Beta(19A582a)上使Python崩溃

Mac上的``库未加载:@ rpath / libcudart.7.5.dylib''TensorFlow错误

dyld:库未加载:@ rpath / libswiftSwiftOnoneSupport.dylib

dyld:库未加载:@ rpath / libswift_stdlib_core.dylib

dyld:库未加载:@ rpath / libswiftAVFoundation.dylib

dyld:未加载库:@ rpath / libswiftAVFoundation.dylib原因:找不到映像

可重定位的dylib(例如嵌入式框架)仅在iOS 8.0及更高版本上受支持(@ rpath / libswift_stdlib_core.dylib)

dyld:库未加载:@ rpath / libswiftCore.dylib

dyld:库未加载:@ rpath / libeng.dylib

CMake和Dyld:库未加载:@ rpath / libLTO.dylib

库未加载:@ rpath / libopenblasp-r0.2.19.dylib

dyld:库未加载:@ rpath / libswiftDispatch.dylib

无法加载TensorFlow运行时; `库未加载:@ rpath / libcudnn.5.dylib`

无法加载Python3 cx-Oracle Oracle Client库:Linux上的“ libclntsh.so”

安装Homebrew时出错:dyld:未加载库:@ rpath / libssl.1.0.0.dylib

在Mac OS 10.16(Big Sur)中通过自制程序构建libzip时找不到libz.dylib

在MacOS Big Sur(M1芯片)上安装自制软件时收到警告

CreateML错误程序:库未加载:@ rpath / libswiftCreateML.dylib

dyld:未加载库:@ rpath / libswiftCoreAudio.dylib引用自:<Framework>原因:找不到图像

无法在Mac上启动android模拟器。库未加载libc ++。1.dylib

npm install oracledb给出错误:找不到$ OCI_LIB_DIR / libclntsh.dylib

从 dylib 返回时 macOS 上的分段错误

如何在 MacOS 上安装 libEGL.dylib?

Docker 上的 cx_Oracle:DPI-1047:无法加载 64 位 Oracle 客户端库:“libclntsh.so

在 MacOS Big Sur 上安装 Netbeans 8.2 找不到 JDK

MacOS Big Sur 11.2.3 上的 pdftk :“预期在:/usr/lib/libstdc++.6.dylib”

无法在 macOS Big Sur 上安装 pyarrow

无法在 macOS Big Sur (Apple M1) 上保护 MariaDB 安装

在 Catalina/Big Sur 上安装 DBD::mysql 失败,找不到“EXTERN.h”文件?