gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 02:21:51 40 4
gpt4 key购买 nike

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

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.

我已经尝试过:

  • 安装在 default path :~/Downloads/instantclient_19_8
  • 安装在~/lib/usr/local/lib
  • 用绝对路径替换符号链接(symbolic link)
  • 使用install_name_tool修改id并更改@rpath但收到警告:对文件进行的更改将使代码签名无效<

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

  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 已清除。

  • 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
  • 强制安装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
  • 安装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

    最佳答案

    问题是DYLD_LIBRARY_PATH运行时环境变量不会传播到 perl make test如上所述here 。而不是运行cpanm DBD::Oracle ,您可以使用例如下载手动运行测试的模块prove 。以下内容对我有用(macOS BigSur 11.2.1),perlbrew perl 版本 5.32.0:

    • 下载并安装instantclient-basic-macos.x64-19.8.0.0.0dbru.dmginstantclient-sdk-macos.x64-19.8.0.0.0dbru.dmg来自https://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

    注释:

    关于oracle - 无法在 macOS Big Sur 上安装 DBD::Oracle => 未找到依赖的 dylib '@rpath/libclntsh.dylib.19.1',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66302271/

    40 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com