2014-06-24 67 views
1

我試圖以用戶身份安裝HTML :: TreeBuilder :: XPath。但我得到這個錯誤:無法用cpanm安裝HTML :: TreeBuilder :: XPath

Building and testing HTML-Parser-3.71 ... FAIL 
! Installing HTML::Entities failed. See /home/user/.cpanm/build.log for details. 

所以,如果我來看看這個文件/home/user/.cpanm/build.log我得到這個錯誤:

Result: FAIL 
Failed 3/48 test programs. 0/423 subtests failed. 
make: *** [test_dynamic] Error 255 
-> FAIL Installing HTML::Entities failed. See /home/user/.cpanm/build.log for details. 
Searching HTML::Parser on cpanmetadb ... 
Already tried HTML-Parser-3.71. Skipping. 
Already tried HTML::Tagset. Skipping. 
-> FAIL Bailing out the installation for HTML-Tree-5.03. Retry with --prompt or --force. 
-> FAIL Bailing out the installation for HTML-TreeBuilder-XPath-0.14. Retry with --prompt or --force. 
3 distributions installed 

所以我嘗試到manualy安裝HTML ::實體和我得到這個錯誤:

Successfully installed HTML-Tagset-3.20 
    Building and testing HTML-Parser-3.71 ... FAIL 
    ! Installing HTML::Entities failed. See /home/user/.cpanm/build.log for details. 
    1 distribution installed 

Can't locate HTML/Tagset.pm in @INC (@INC contains: /home/user/.cpanm/work/1403630727.28688/HTML-Parser-3.71/blib/lib /home/user/.cpanm/work/1403630727.28688/HTML-Parser-3.71/blib/arch /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /home/user/.cpanm/work/1403630727.28688/HTML-Parser-3.71/blib/lib/HTML/TokeParser.pm line 10. 

所以說,它無法找到HTML ::標記集,但它一直研究所只等了幾行!而在最後,我得到這個錯誤:

Result: FAIL 
Failed 3/48 test programs. 0/423 subtests failed. 
make: *** [test_dynamic] Error 255 
-> FAIL Installing HTML::Entities failed. See /home/user/.cpanm/build.log for details. 
1 distribution installed 

,如果我看一看/home/user/.cpanm/build.log我得到完全相同的輸出。

請問有什麼不對?

+1

試「的perl -MHTML ::標記集 - d -e 0',看看會發生什麼。它可以找到並加載軟件包,或者對你有影響嗎? –

+0

@LenJaffe它找不到該模塊: 無法在INC中找到HTML/Tagset.pm(INC包含:/ etc/perl /usr/local/lib/perl/5.14.2/usr/local/share /perl/5.14.2/usr/lib/perl5/usr/share/perl5/usr/lib/perl/5.14/usr/share/perl/5.14/usr/local/lib/site_perl。)。 我該怎麼做才能讓perl找到模塊? PS:我不得不刪除「@」,因爲SO說我不能通知多個用戶。 – Antoine

+0

搬到答案的地方,我有更多的自由來表達我自己 –

回答

1

鑑於您無法從命令行找到HTML :: Tagset模塊,可能您並未實際安裝它,儘管被告知您已經安裝了該模塊。

另外一個測試吧爾德是:

$ perldoc HTML::Tagset 

然後我會看它使用locate(1)

$ locate HTML/Tagset.pm 

你可能會得到大量輸出,你必須要經歷的,或者你可能沒有。您可能會被告知所依賴的數據庫未被初始化或已過期。您可以刷新數據庫,或嘗試find(1)

$ find/-name 'Tagset.pm' -print | less 

如果你仍然無法找到它,或者你厭倦搜索的,那麼就火了你最喜歡的CPAN客戶端,並安裝HTML::Tagset,然後HTML::Entities明確。

+0

謝謝你的回答。事實上,這本手冊並沒有與perldoc一起顯示,並且找到了我所在的許多路徑。最後,我遵循你的建議,通過以其他方式安裝模塊。我沒有使用cpan,但我已經安裝了debian軟件包。這很容易。謝謝 ! – Antoine

+0

我很高興能幫上忙。 –

0

我還沒告訴cpanminus使用我的本地圖書館。

下面是安裝所有模塊作爲用戶的解決方案:

cd ~/; 
cpanm local::lib; 
echo 'eval `perl -I$HOME/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bashrc ; 
source ~/.bashrc; 

在那之後,我可以安裝所有模塊和依賴關係爲用戶提供

cpanm module::name