简体   繁体   English

在Windows 7上运行的Strawberry Perl上安装CPAN模块时遇到问题

[英]Having trouble installing a CPAN module on Strawberry Perl running on Windows 7

I've got Strawberry Perl installed on a Windows 7 system. 我在Windows 7系统上安装了Strawberry Perl。 Also have a MinGW installation located in C:\\MinGW\\msys\\bin (where my make.exe resides). 还有一个MinGW安装位于C:\\ MinGW \\ msys \\ bin(我的make.exe所在的位置)。 Strawberry is located in c:\\Strawberry\\Perl\\bin. 草莓位于c:\\ Strawberry \\ Perl \\ bin。

I'm trying to install HTML::TableContentParser into a local library, and the script that installs the module fails with a "cannot find the path specified" error, and tells me to build manually, which I don't know how to do, and have been unable to find instructions that work. 我正在尝试将HTML :: TableContentParser安装到本地库中,并且安装模块的脚本失败并显示“无法找到指定的路径”错误,并告诉我手动构建,我不知道该怎么做,并一直无法找到有效的说明。 It always comes back to the makefile somehow. 它总是以某种方式返回到makefile。

Here's what I get when I run "cpan HTML::TableContentParser" from my c:\\strawberry\\perl\\bin directory: 这是我从c:\\ strawberry \\ perl \\ bin目录运行“cpan HTML :: TableContentParser”时得到的结果:

C:\Users\joel>cd c:\strawberry\perl\bin

c:\Strawberry\perl\bin>cpan HTML::TableContentParser
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: Storable loaded ok (v2.56_01)
Reading '\c\Users\joel\.cpan\Metadata'
  Database was generated on Mon, 15 May 2017 15:54:01 GMT
Running install for module 'HTML::TableContentParser'
CPAN: Digest::SHA loaded ok (v5.96)
CPAN: Compress::Zlib loaded ok (v2.07)
Checksum for \c\Users\joel\.cpan\sources\authors\id\S\SD\SDRABBLE\HTML-       TableContentParser-0.13.tar.gz ok
The system cannot find the path specified.
Uncompressed \c\Users\joel\.cpan\sources\authors\id\S\SD\SDRABBLE\HTML-TableContentParser-0.13.tar.gz successfully
Using Tar:/usr/bin/tar xf "HTML-TableContentParser-0.13.tar":
The system cannot find the path specified.
Couldn't untar HTML-TableContentParser-0.13.tar: child exited with value 1
CPAN: YAML loaded ok (v1.21)
  SDRABBLE/HTML-TableContentParser-0.13.tar.gz
  Had problems unarchiving. Please build manually

Try the following: 请尝试以下方法:

  1. Do not use separate MinGW it already comes packed with Strawberry Perl. 不要使用单独的MinGW,它已经装满了Strawberry Perl。 Make sure you have a recent version of Strawberry Perl. 确保你有最新版本的Strawberry Perl。

  2. Download the tar.gz for the perl module from any of the sites(Metacpan or Cpan). 从任何站点(Metacpan或Cpan)下载perl模块的tar.gz。

  3. Use winzip to unzip it which will give you all files extracted to a location. 使用winzip解压缩它将为您提供所有提取到某个位置的文件。

  4. Now open command prompt and change directory to the one where you extracted the tar.gz for the perl module. 现在打开命令提示符并将目录更改为您为perl模块解压缩tar.gz的目录。

  5. Run the following commands then: 然后运行以下命令:

    • perl Makefile.pl perl Makefile.pl
    • dmake dmake的
    • dmake test dmake测试
    • dmake install dmake安装

The command dmake test one is optional, if you get errors here try skipping to the next command and try using the module in your scripts. 命令dmake test one是可选的,如果你在这里遇到错误,请尝试跳到下一个命令并尝试在脚本中使用该模块。 As many times the test fails does not means the module won't install or work properly. 多次测试失败并不意味着模块将无法安装或正常工作。 If there is error the module will give error in installation too. 如果出现错误,模块也会在安装时出错。

Make sure you have the Makefile.pl file in the extracted directory. 确保在解压缩的目录中包含Makefile.pl文件。 This will install the module without any issues. 这将安装模块没有任何问题。

I am assuming that you are working on a Windows system. 我假设您正在使用Windows系统。 Do let me know if you face any errors still. 如果您仍然遇到任何错误,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM