2016-12-01 52 views
3

我在cpanm下安装了一个模块,显然不正确。它在系统perl下运行时可见且可用,但不在perlbrew下运行。但是,perlbrews cpanm指出模块已成功安装。最好的步骤?perlbrew perl cpanm故障

/Users/john/perl5/perlbrew/perls/perl-5.18.2/bin/perl 
/Users/john/perl5/bin/cpanm 
#!/usr/bin/perl 
MM: INSTALL_BASE=/Users/john/perl5 
MB: --install_base "/Users/john/perl5" 

Note: .pl file contains following 
#!/usr/bin/env perl 

perlbrew开关后...

declare -x PERL5LIB="/Users/john/perl5/lib/perl5" 
declare -x PERLBREW_BASHRC_VERSION="0.76" 
declare -x PERLBREW_HOME="/Users/john/.perlbrew" 
declare -x PERLBREW_MANPATH="/Users/john/perl5/perlbrew/perls/perl-5.18.2/man" 
declare -x PERLBREW_PATH="/Users/john/perl5/perlbrew/bin:/Users/john/perl5/perlbrew/perls/perl-5.18.2/bin" 
declare -x PERLBREW_PERL="perl-5.18.2" 
declare -x PERLBREW_ROOT="/Users/john/perl5/perlbrew" 
declare -x PERLBREW_VERSION="0.76" 
declare -x PERL_LOCAL_LIB_ROOT="/Users/john/perl5" 
declare -x PERL_MB_OPT="--install_base \"/Users/john/perl5\"" 
declare -x PERL_MM_OPT="INSTALL_BASE=/Users/john/perl5" 

Link to sybase install with hombrew

+2

请提供'which perl;哪个cpanm; head -n 1“$(which cpanm)”; printf'MM:%s \ n'“$ PERL_MM_OPT”; printf'MB:%s \ n'“$ PERL_MB_OPT”' – ikegami

+0

在perlbrew中尝试以下操作。 '$ cpanm --interactive -v App :: cpanoutdated','$ cpan-outdated','$ cpanm --interactive -v App :: CPAN :: Fresh'。然后执行'cpanm '。 –

+0

检查刚刚安装的文件 – KeepCalmAndCarryOn

回答

2

cpanm不安装任何模块。它只是运行与您想要安装的发行版一起打包的安装程序。通过PERL_MM_OPTPERL_MB_OPT env vars,指示这些安装者将模块安装在错误的位置。摆脱他们。

+0

上的权限是否正确,但不会根据使用哪个cpanm来安装更改位置。我进行了建议。在perlbrew下使用perl,找不到DBD/Sybase.pm。使用系统Perl,一切都很好。 /Users/john/perl5/lib/perl5/darwin-thread-multi-2level/DBD/Sybase.pm。想让某些cpanm下一次安装是perlbrew的副本 – paulj

+0

PERL5LIB =“/ Users/john/perl5/lib/perl5”这就是问题所在。如何将文件从这里移动到〜/ perl5/perlbrew/perls/perl-5.18.2/lib/5.18.2/ – paulj

+0

非常感谢这些信息。不知道我是如何得到这一点。 – paulj

0

我有一个类似的问题,无法理解如何为目标Perl制作cpanm安装模块。

perlbrew --switch --notest install perl-stable 

我认为--switch将指导我的使用到新的Perl,我可以看到新的Perl在那里通过:

​​

但随着cpanm安装模块是我已经通过安装perlbrew不工作(该模块将不会被发现),当我将通过我的运行脚本:

perlbrew exec perl myscript.pl 

which-version-of-perl post让我考虑是m aybe --switch没有达到我想要的效果。运行以下命令允许cpanm开始安装到预定的Perl:

perlbrew switch perl-5.26.1