Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在macOS Catalina上安装带有Oracle即时客户端的Perl DBD::Oracle_Oracle_Macos_Perl_Macos Catalina - Fatal编程技术网

如何在macOS Catalina上安装带有Oracle即时客户端的Perl DBD::Oracle

如何在macOS Catalina上安装带有Oracle即时客户端的Perl DBD::Oracle,oracle,macos,perl,macos-catalina,Oracle,Macos,Perl,Macos Catalina,我正在运行macOS Catalina 10.15.7,需要安装Oracle Instant Client来运行连接到数据库的Perl脚本 1.安装Oracle即时客户端 我下载了我需要的软件包: 基本照明组件(DMG) SDK包(DMG) ODBC包(DMG) 从Instant Client 19.8开始,并遵循没有任何问题(只是复制和粘贴) 文件在/Users/username/Downloads/instantclient_19_8 export ORACLE_HOME=/Users/

我正在运行macOS Catalina 10.15.7,需要安装Oracle Instant Client来运行连接到数据库的Perl脚本

1.安装Oracle即时客户端 我下载了我需要的软件包:

  • 基本照明组件(DMG)
  • SDK包(DMG)
  • ODBC包(DMG)
从Instant Client 19.8开始,并遵循没有任何问题(只是复制和粘贴)

文件在
/Users/username/Downloads/instantclient_19_8

export ORACLE_HOME=/Users/username/Downloads/instantclient_19_8
2.设置
ORACLE\u HOME
接下来,我将ORACLE_HOME设置为
/Users/username/Downloads/instantclient_19_8

export ORACLE_HOME=/Users/username/Downloads/instantclient_19_8
3.安装DBD::Oracle 当我尝试安装
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
Configuring DBD-Oracle-1.80 ... N/A
! Configure failed for DBD-Oracle-1.80. See /Users/username/.cpanm/work/1608142485.48272/build.log for details.
日志文件的内容:

$ cat /Users/username/.cpanm/work/1608142485.48272/build.log
cpanm (App::cpanminus) 1.7044 on perl 5.032000 built for darwin-thread-multi-2level
Work directory is /Users/username/.cpanm/work/1608142485.48272
You have make /usr/bin/make
You have LWP 6.47
You have /usr/bin/tar: bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6
You have /usr/bin/unzip
Searching DBD::Oracle () on cpanmetadb ...
--> Working on DBD::Oracle
Fetching http://www.cpan.org/authors/id/M/MJ/MJEVANS/DBD-Oracle-1.80.tar.gz
-> OK
Unpacking DBD-Oracle-1.80.tar.gz
Entering DBD-Oracle-1.80
Checking configure dependencies from META.json
Checking if you have Config 0 ... Yes (5.032000)
Checking if you have Encode 0 ... Yes (3.06)
Checking if you have Math::BigInt 0 ... Yes (1.999818)
Checking if you have Devel::Peek 0 ... Yes (1.28)
Checking if you have Test::More 0 ... Yes (1.302177)
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.44)
Checking if you have Data::Dumper 0 ... Yes (2.174)
Checking if you have DBI 1.623 ... Yes (1.643)
Checking if you have Test::NoWarnings 0 ... Yes (1.04)
Configuring DBD-Oracle-1.80
Running Makefile.PL
Using DBI 1.643 (for perl 5.032000 on darwin-thread-multi-2level) installed in /usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/darwin-thread-multi-2level/auto/DBI/
Configuring DBD::Oracle for perl 5.032000 on darwin (darwin-thread-multi-2level)

If you encounter any problem, a collection of troubleshooting
guides are available under lib/DBD/Oracle/Troubleshooting.
'DBD::Oracle::Troubleshooting' is the general troubleshooting
guide, while platform-specific troubleshooting hints
live in their labelled sub-document (e.g., Win32
hints are gathered in 'lib/DBD/Oracle/Troubleshooting/Win32.pod').

Trying to find an ORACLE_HOME
Your DYLD_LIBRARY_PATH env var is set to ''

      The ORACLE_HOME environment variable is not set and I couldn't guess it.
      It must be set to hold the path to an Oracle installation directory
      on this machine (or a machine with a compatible architecture).
      See the appropriate troubleshooting guide for your OS for more information.
      ABORTED!

-> N/A
-> FAIL Configure failed for DBD-Oracle-1.80. See /Users/username/.cpanm/work/1608142485.48272/build.log for details.

我已经读到,
ORACLE\u HOME
应该设置为包含
/bin
目录的目录的值,但是我找不到任何
/bin

brew install perl
ln -s $HOME/Downloads/instantclient_19_8 $HOME/instantclient
export DYLD_LIBRARY_PATH=$HOME/instantclient
cpan -i -T DBI
cpan -i -T DBD::Oracle
一般来说,不要为即时客户端设置ORACLE_主页。(这可能导致读取错误的配置文件)。ORACLE_HOME用于“完整”数据库或完整客户端安装,而不是即时客户端。但是,一些安装程序仍然引用该变量来查找生成文件,因此您将需要它-至少在生成时需要它。DBD::Oracle将在内部搜索即时客户端,如果未设置$Oracle\U HOME,则使用$HOME/instantclient

macOS已经逐渐消除了DYLD_LIBRARY_PATH的用处,因为它不会传播到子shell。这意味着它不能可靠地使用。在Mojave上,我发现我也可以将即时客户端库复制到$HOME/lib/,而不需要设置DYLD\u LIBRARY\u路径


旁注:如果您使用的是DBD::Oracle,则不需要即时客户端ODBC包。

如果有人投票赞成关闭该问题,请您写一篇评论,解释原因?(你所说的
是什么意思?这个问题不符合堆栈溢出准则
?)