MaxMind GeoIP正在使用Perl调用的Mojave。
我试图将我的macOS安装从Perl5.26升级到5.30。使用MacPorts安装并激活5.30,然后使用CPAN安装Perl模块。有几个端口在安装时出错。我不得不强迫他们。
尝试了一下,因为一个Perl模块出现了问题,所以失败了。
thvv lib$ ipcity
Could not find a suitable MaxMind::DB::Reader implementation: List::Util version 1.56 required--this is only version 1.5 at /opt/local/lib/perl5/site_perl/5.30/List/AllUtils.pm line 8.在CPAN中,我试图安装List::Util。上面说版本1.56已经安装好了。
cpan[4]> i List::Util
Module id = List::Util
CPAN_USERID PEVANS (Paul Evans <leonerd@leonerd.org.uk>)
CPAN_VERSION 1.56
CPAN_FILE P/PE/PEVANS/Scalar-List-Utils-1.56.tar.gz
MANPAGE List::Util - A selection of general-utility list subroutines
INST_FILE /opt/local/lib/perl5/site_perl/5.30/darwin-thread-multi-2level/List/Util.pm
INST_VERSION 1.56我的环境都指向Perl版本5.30
perl --version
This is perl 5, version 30, subversion 3 (v5.30.3) built for darwin-thread-multi-2level
env | grep 5.30
PERL5LIB=/Users/thvv/bin:/opt/local/lib/perl5/5.30
PERL_MB_OPT=--install_base "/opt/local/lib/perl5/5.30"
PERL_LOCAL_LIB_ROOT=/opt/local/lib/perl5/5.30
PERL_MM_OPT=INSTALL_BASE=/opt/local/lib/perl5/5.30如何获得List::AllUtils以查找已安装的List::Util的版本?
(2021年7月23日星期五)应要求补充资料:
[thvv lib]$ head -1 ~/bin/ipcity
#!/usr/local/bin/perl -I/usr/home/thvv/bin-- (在没有-I子句的情况下尝试并得到了相同的输出)
[thvv bin]$ perl -MList::Util=999 -e1
List::Util version 999 required--this is only version 1.5 at /opt/local/lib/perl5/5.30/Exporter/Heavy.pm line 125.
BEGIN failed--compilation aborted.-在我的文件系统中查找模块
[thvv bin]$ ls -l /opt/local/lib/perl5/5.30//darwin-thread-multi-2level/List/
total 16
-r--r--r--+ 1 root admin 21126 Jul 1 06:52 Util.pm
drwxr-xr-x+ 3 root admin 96 Jul 18 12:05 Util/
[thvv bin]$ ls -l /opt/local/lib/perl5/5.30//darwin-thread-multi-2level/List/Util
total 0
-r--r--r--+ 1 root admin 1018 Jul 1 06:52 XS.pm--我还调用了cpan并执行了一个“强制安装列表::Util”
Running install for module 'List::Util'
Fetching with LWP:
http://www.cpan.org/authors/id/P/PE/PEVANS/CHECKSUMS
Checksum for /var/root/.cpan/sources/authors/id/P/PE/PEVANS/Scalar-List-Utils-1.56.tar.gz ok
Scanning cache /var/root/.cpan/build for sizes
............................................................................DONE
Configuring P/PE/PEVANS/Scalar-List-Utils-1.56.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for List::Util
Writing MYMETA.yml and MYMETA.json
PEVANS/Scalar-List-Utils-1.56.tar.gz
/opt/local/bin/perl5.30 Makefile.PL -- OK
Running make for P/PE/PEVANS/Scalar-List-Utils-1.56.tar.gz
cp lib/Sub/Util.pm blib/lib/Sub/Util.pm
cp lib/List/Util.pm blib/lib/List/Util.pm
cp lib/List/Util/XS.pm blib/lib/List/Util/XS.pm
cp lib/Scalar/Util.pm blib/lib/Scalar/Util.pm
Running Mkbootstrap for Util ()
chmod 644 "Util.bs"
"/opt/local/bin/perl5.30" -MExtUtils::Command::MM -e 'cp_nonempty' -- Util.bs blib/arch/auto/List/Util/Util.bs 644
"/opt/local/bin/perl5.30" "/opt/local/lib/perl5/5.30/ExtUtils/xsubpp" -typemap '/opt/local/lib/perl5/5.30/ExtUtils/typemap' ListUtil.xs > ListUtil.xsc
mv ListUtil.xsc ListUtil.c
/usr/bin/cc -c -fno-common -DPERL_DARWIN -pipe -Os -fno-strict-aliasing -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV -Wno-error=implicit-function-declaration -O3 -DVERSION=\"1.56\" -DXS_VERSION=\"1.56\" "-I/opt/local/lib/perl5/5.30/darwin-thread-multi-2level/CORE" -DPERL_EXT -DUSE_PPPORT_H ListUtil.c
rm -f blib/arch/auto/List/Util/Util.bundle
/usr/bin/cc -bundle -undefined dynamic_lookup -L/opt/local/lib -Wl,-headerpad_max_install_names -fstack-protector-strong ListUtil.o -o blib/arch/auto/List/Util/Util.bundle \
\
chmod 755 blib/arch/auto/List/Util/Util.bundle
Manifying 4 pod documents
PEVANS/Scalar-List-Utils-1.56.tar.gz
/usr/bin/make -- OK
Running make test for PEVANS/Scalar-List-Utils-1.56.tar.gz
"/opt/local/bin/perl5.30" -MExtUtils::Command::MM -e 'cp_nonempty' -- Util.bs blib/arch/auto/List/Util/Util.bs 644
PERL_DL_NONLAZY=1 "/opt/local/bin/perl5.30" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00version.t ......... ok
t/any-all.t ........... ok
t/blessed.t ........... ok
t/dualvar.t ........... ok
t/exotic_names.t ...... ok
t/first.t ............. ok
t/getmagic-once.t ..... ok
t/head-tail.t ......... ok
t/isvstring.t ......... ok
t/lln.t ............... ok
t/max.t ............... ok
t/maxstr.t ............ ok
t/mesh.t .............. ok
t/min.t ............... ok
t/minstr.t ............ ok
t/openhan.t ........... ok
t/pair.t .............. ok
t/product.t ........... ok
t/prototype.t ......... ok
t/readonly.t .......... ok
t/reduce.t ............ ok
t/reductions.t ........ ok
t/refaddr.t ........... ok
t/reftype.t ........... ok
t/rt-96343.t .......... ok
t/sample.t ............ ok
t/scalarutil-proto.t .. ok
t/shuffle.t ........... ok
t/stack-corruption.t .. ok
t/subname.t ........... ok
t/sum.t ............... ok
t/sum0.t .............. ok
t/tainted.t ........... ok
t/uniq.t .............. ok
t/uniqnum.t ........... ok
t/weak.t .............. ok
t/zip.t ............... ok
All tests successful.
Files=37, Tests=2144, 4 wallclock secs ( 0.24 usr 0.10 sys + 2.88 cusr 0.42 csys = 3.64 CPU)
Result: PASS
Lockfile removed.
PEVANS/Scalar-List-Utils-1.56.tar.gz
/usr/bin/make test -- OK
Running make install for PEVANS/Scalar-List-Utils-1.56.tar.gz
"/opt/local/bin/perl5.30" -MExtUtils::Command::MM -e 'cp_nonempty' -- Util.bs blib/arch/auto/List/Util/Util.bs 644
Manifying 4 pod documents
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Appending installation info to /opt/local/lib/perl5/5.30/darwin-thread-multi-2level/perllocal.pod
PEVANS/Scalar-List-Utils-1.56.tar.gz
/usr/bin/make install -- OK(2021年7月23日,更多)
[thvv bin]$ which perl
/opt/local/bin/perl
[thvv bin]$ ls -l /opt/local/bin/perl
lrwxr-xr-x 1 root wheel 8 Jul 21 12:28 /opt/local/bin/perl@ -> perl5.30
[thvv bin]$ file `which perl`
/opt/local/bin/perl: Mach-O 64-bit executable x86_64(美国东部时间2021年7月23日12:59)试着看/opt/local/lib/perl5/5.30//darwin-thread-multi-2level/List/Util/XS.pm,这似乎是1.5的来源。
强制安装,没有改变
package List::Util::XS;
use strict;
use warnings;
use List::Util;
our $VERSION = "1.50"; # FIXUP
$VERSION = eval $VERSION; # FIXUP
1;
[snipped pod]我试着编辑/opt/local/lib/perl5/site_perl/5.30/List/AllUtils.pm以将1.50更改为1.56。重新启动这台机器以求好运。在List/AllUtils.pm第8行仍然失败,表示当前版本为1.50。
(2021年7月24日08:13 ) @ikegami要求
[thvv@Uly2 ~]$ echo 'o conf' | cpan | grep 'make\|mbuild'; set | grep ^PERL
make [/usr/bin/make]
make_arg []
make_install_arg []
make_install_make_command [sudo /usr/bin/make]
makepl_arg []
mbuild_arg []
mbuild_install_arg []
mbuild_install_build_command [sudo ./Build]
mbuildpl_arg []
PERL5LIB=/Users/thvv/bin:/opt/local/lib/perl5/5.30
PERL_LOCAL_LIB_ROOT=/opt/local/lib/perl5/5.30
PERL_MB_OPT='--install_base "/opt/local/lib/perl5/5.30"'
PERL_MM_OPT=INSTALL_BASE=/opt/local/lib/perl5/5.30好的,我删除了Perl 5.30,安装了5.34,重新加载了我的Perl模块。但还是失败了。
Could not find a suitable MaxMind::DB::Reader implementation: List::Util version 1.56 required--this is only version 1.55 at /opt/local/lib/perl5/site_perl/5.34/List/AllUtils.pm line 8.
BEGIN failed--compilation aborted at /opt/local/lib/perl5/site_perl/5.34/List/AllUtils.pm line 8.List::AllUtils中失败的"use“行查找List::Util版本1.56。List::Util的.pm文件位于.pm中,并使用1.56版本调用XSLoader::load('List::Util',$XS_VERSION)。这反过来又试图调用/opt/local/lib/perl5/site_perl/5.34/darwin-thread-multi-2level/auto/List/Util/Util.bundle,这是一个Mac二进制文件。XSLoader似乎没有加载List::Util的二进制版本。
啊哈。我看到/opt/local/lib/perl 5/5.34和/opt/local/lib/perl 5/site_perl/5.34是具有不同内容的不同目录。我用CPAN加载的文件进入site_perl/5.34。但是列表::Util在5.34。只有一个程序在两个目录之间有实质性的代码更改。
因此,在Mac上,我是否应该将/opt/local/lib/perl 5/site_perl/5.34/改为/opt/local/lib/perl 5/5.34/?
发布于 2021-07-23 20:24:16
ipcity使用/usr/local/bin/perl,这是到/opt/local/bin/perl的一个符号链接。这是在路径中找到的第一个perl。如果我们检查cpan的shebang,我们会找到相同的perl引用(如安装尝试的输出所示)。您可能有不止一个Perl安装,但这里只涉及一个。因此,te问题不是为错误的perl安装List::Util的问题。
加载列表::Util loads版本显示已经加载了版本1.5。但是安装了1.56版本。这意味着模块安装在一个非标准的位置,但perl没有被告知要查看该位置。
您的环境通知模块安装程序ExtUtils::MakeMaker和module :Build:Build to install /opt/local/lib/perl5/5.30下。具体来说,它通知安装程序在.pm (或相应的arch dir)中安装/opt/local/lib/perl5/5.30/lib/perl5文件,但是没有告诉perl在这个目录中查找;它被告知在/opt/local/lib/perl5/5.30中查找。这是错误的,也是问题的症结所在。
修复PERL5LIB。
也就是说,在使用PERL_MB_OPT和PERL_MM_OPT时,在/opt中设置perl是没有意义的。您的perl的默认安装路径应该是合理的。你可以看到他们在用什么
perl -V:'.*inst.*'最后,如果没有设置PERL_MB_OPT和PERL_MM_OPT,那么设置PERL5LIB或PERL_LOCAL_LIB_ROOT也是没有意义的。
我想你应该取消所有这四个变量。
https://stackoverflow.com/questions/68490230
复制相似问题