Perl中的--force命令会确定安装模块吗? [英] --force command in perl will install modules for sure?

查看:358
本文介绍了Perl中的--force命令会确定安装模块吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试安装[Math :: TrulyRandom] [1]一个随机(相对于伪随机)数字生成器,在cpan.org上,只有源代码可用.我第一次尝试安装它失败,然后告诉我使用--force,以便第二次安装它.我第二次也是失败的.有人可以解释我是否正确使用了--force命令,或者是否存在另一种安装Math :: TrulyRandom的方法?预先感谢.

I tried installing [Math::TrulyRandom][1] a random (versus pseudo random) number generator, and on cpan.org, there is only the source code available. My first attempt of installing it was a failure, and then told me to use the --force so that it will be installed the second time. My second time is a failure as well. Can someone explain if I used the --force command correctly, or if there is another way to install Math::TrulyRandom? Thanks in advance.

C:\Users\Jlinne\Documents>                    cpanm Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476406246.12316\build.log for details. Retry with --force to force install it.

C:\Users\Jlinne\Documents>                    cpanm --force Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476406259.5096\build.log for details. Retry with --force to force install it.

我也尝试过这样做,但是我不明白这意味着什么(例如,倒数第二行代码):

I also tried this, but I do not understand what this means (eg. the second to last line of code):

C:\Users\Jlinne\.cpanm\work\1476412047.4284\Math-TrulyRandom-1.0>exit
Building Math-TrulyRandom-1.0 failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s] e
FAIL
! You don't seem to have a PAGER :/
Building Math-TrulyRandom-1.0 failed.

输出:

C:\Users\Jlinne\Documents>                    cpanm Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476549822.10400\build.log for details. Retry with --force to force install it.

C:\Users\Jlinne\Documents>                    cpanm --prompt Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... Building Math-TrulyRandom-1.0 failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s] l
Entering C:/Users/Jlinne/.cpanm/work/1476549847.11132/Math-TrulyRandom-1.0 with C:\WINDOWS\system32\cmd.exe
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>perl Makefile.PL
Generating a dmake-style Makefile
Writing Makefile for Math::TrulyRandom
Writing MYMETA.yml and MYMETA.json

C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>

推荐答案

它很可能在构建阶段而不是测试阶段失败. --force选项仅允许cpanm忽略测试结果.您也应该几乎永远不要使用--force.改用--prompt,然后在出现提示时选择look选项.一旦将您放入构建目录,请运行perl Build.plperl Makefile.PL(以模块使用的为准).寻找并修复它们(如果可以的话).如果您无法修复它们,请在SO上询问它们.如果它创建了一个makefile,则运行nmake.查找错误等.然后运行nmake test.查找错误等.所有这些都起作用后,退出外壳程序,您将返回到提示.选择retry并且应该安装.

It likely failed in the building phase and not the testing phase. The --force option just allows cpanm to ignore the results of tests. You should also almost never use --force. Use --prompt instead, and then choose the look option when prompted. Once it drops you in the build directory, run perl Build.pl or perl Makefile.PL (whichever the module uses). Look for and, if you can, fix them. If you can't fix them, ask about them on SO. If it creates a makefile, then run nmake. Look for errors, etc. Then run nmake test. Look for errors, etc. Once all of that works, exit the shell and you will be returned to the prompt. Chose retry and it should install.

您还可以只查看构建日志,看看出了什么问题:C:\ Users \ Jlinne.cpanm \ work \ 1476406259.5096 \ build.log

You could also just look at the build log and see what went wrong: C:\Users\Jlinne.cpanm\work\1476406259.5096\build.log

我还刚刚注意到您正在使用MS Windows,确定您具有有效的构建环境(即已安装nmake,具有C编译器等)吗?

I also just noticed you are using MS Windows, are you sure you have a valid build environment (ie nmake is installed, you have a C compiler, etc)?

这篇关于Perl中的--force命令会确定安装模块吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆