找不到version.pm而试图在CentOS-7安装DBD-PG-2.19.3

问题描述 投票:0回答:4

在CentOS 7。

神谕DBD安装就好了我有PostgreSQL的版本有问题。

这是我在运行该脚本:

set -x -e
sudo yum -y install perl-devel
sudo yum -y install perl-DBI

cp ./DBD* /tmp
pushd /tmp
tar xvf DBD-Oracle-1.52.tar
tar xvf DBD-Pg-2.19.3.tar
pushd DBD-Oracle-1.52
perl Makefile.PL
sudo make
sudo make install
popd
pushd DBD-Pg-2.19.3
perl Makefile.PL
sudo make
sudo make install

PostgreSQL的DBD的perl Makefile.PL回报

++ perl Makefile.PL
Configuring DBD::Pg 2.19.3
PostgreSQL version: 90224 (default port: 5432)
POSTGRES_HOME: (not set)
POSTGRES_INCLUDE: /usr/include
POSTGRES_LIB: /usr/lib64
OS: linux
Warning: prerequisite Test::More 0.61 not found.
Warning: prerequisite version 0 not found.
Could not eval '
                package ExtUtils::MakeMaker::_version;
                no strict;
                BEGIN { eval {
                    # Ensure any version() routine which might have leaked
                    # into this package has been deleted.  Interferes with
                    # version->import()
                    undef *version;
                    require version;
                    "version"->import;
                } }

                local $VERSION;
                $VERSION=undef;
                do {
                        use version; our $VERSION = qv('2.19.3');
                };
                $VERSION;
            ' in Pg.pm: Can't locate version.pm in @INC (@INC contains: t/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 9) line 16, <$fh> line 19.
BEGIN failed--compilation aborted at (eval 9) line 16, <$fh> line 19.
WARNING: Setting VERSION via file 'Pg.pm' failed
 at /usr/share/perl5/vendor_perl/ExtUtils/MakeMaker.pm line 619.
Using DBI 1.627 (for perl 5.016003 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/vendor_perl/auto/DBI/
Writing Makefile for DBD::Pg
++ sudo make
Skip blib/lib/DBD/testme.tmp.pl (unchanged)
Skip blib/lib/Bundle/DBD/Pg.pm (unchanged)
Skip blib/lib/DBD/Pg.pm (unchanged)
gcc -c  -I/usr/include -I/usr/lib64/perl5/vendor_perl/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPGLIBVERSION=90224 -DPGDEFPORT=5432 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic  -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"undef\" -DXS_VERSION=\"undef\" -fPIC "-I/usr/lib64/perl5/CORE"   Pg.c
In file included from Pg.xs:13:0:
Pg.h:36:22: fatal error: libpq-fe.h: No such file or directory
 #include "libpq-fe.h"
                      ^
compilation terminated.
make: *** [Pg.o] Error 1

然而,定位显示:

/common/oracle/tfa/austin/tfa_home/perl/lib/5.22.0/version.pm
/common/oracle/tfa/austin/tfa_home/perl/lib/5.22.0/ExtUtils/MakeMaker/version.pm
/common/orainst/perl/lib/5.22.0/version.pm
/common/orainst/perl/lib/5.22.0/ExtUtils/MakeMaker/version.pm
/opt/oracle/product/18c/dbhomeXE/perl/lib/5.22.0/version.pm
/opt/oracle/product/18c/dbhomeXE/perl/lib/5.22.0/ExtUtils/MakeMaker/version.pm
perl centos7 dbd dbd-pg
4个回答
2
投票

您需要安装完整的Perl的核心。在CentOS的7这个包被称为perl-core,并perl只是解释,不适合,如果你真的想要自己使用它。完整的Perl被重新命名为perl(和解释更名为perl-interpreter)在最新版本的Fedora的。

yum install perl-core

更妙的是build your own Perl,这样当你需要在不与系统的Perl可以通过其他的东西可以使用,而不是指望这些更新搞乱你可以安装的东西进去。如果你坚持使用系统的Perl,建议以隔离您在安装时不使用local::libCarton包管理器的任何模块。

它看起来像你已经有Perl的一个单独的版本,因为含5.22.0这些路径从系统中的perl CentOS中7的Perl的此安装将无法管理或与任何你与yum安装,除非它从Oracle存储库的都没有。安装可以处理该模块的依赖性模块的正确方法是用cpan客户端,或像cpanm其他客户端。只要确保运行Perl的要模块安装到和使用的可执行文件。


0
投票

这是(目前)的问题prerequisite Test::More 0.61 not found。 这是解决方案https://superuser.com/a/1111321/156111

"

yum install make cpan

然后配置与CPAN您的perl。只需在命令提示符下输入CPAN并回答是肯定的所有交互问题。

然后更新您CPAN经理:

#cpan install Bundle::CPAN
#cpan reload cpan

并立即安装您感兴趣的软件包:

#cpan install Test::More

"


0
投票

如果你感到快乐使用系统Perl和其相关的Perl库(如你似乎是因为你正在运行yum install perl-DBI),那么你可以使用DBD :: PG的预包装版本。

 sudo yum install perl-DBD-Pg

这将自动拉所需的任何其他RPM。

DBD :: Oracle是更难。预建的包不可用(大概,因为甲骨文不是开源的),但你也许可以建立以下the method I described a few years ago自己的RPM。您需要确保Oracle客户端库(及其相关的头文件)都已经安装。


0
投票
set -x -e
sudo yum -y install perl-devel
sudo yum -y install perl-DBI
sudo yum -y install perl-version perl-Data-Dumper
sudo yum -y install postgresql-devel
cp ./DBD* /tmp
pushd /tmp
tar xvf DBD-Oracle-1.52.tar
tar xvf DBD-Pg-2.19.3.tar
pushd DBD-Oracle-1.52
perl Makefile.PL
sudo make
sudo make install
popd
pushd DBD-Pg-2.19.3
perl Makefile.PL
sudo make
sudo make install
cd ~/ora2pg
perl Make.PL
sudo make
sudo make install
© www.soinside.com 2019 - 2024. All rights reserved.