2015-09-22 111 views
0

當我嘗試安裝cpan模塊時,出現以下錯誤,我嘗試了使用Google搜索,無法找到解決方案。PDF ::使用cpan linux命令創建模塊安裝失敗?

Catching error: "Can't locate object method \"Create\" via package \"install PDF\" (perhaps you forgot to load \"install PDF\"?) at /usr/share /perl5/CPAN.pm line 376, <STDIN> line 1.\cJ" at /usr/share/perl5/CPAN.pm line 392, <STDIN> line 1. 
CPAN::shell() called at /usr/share/perl5/App/Cpan.pm line 295 
App::Cpan::_process_options('App::Cpan') called at /usr/share/perl5/App/Cpan.pm line 364 
App::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11 
+0

你使用了什麼命令? (所有符號都指向「用戶錯誤」。) – melpomene

+0

我將命令作爲cpan使用,然後使用命令作爲安裝「PDF :: Create」 –

回答

3

你的錯誤可以通過執行以下再現:

$ cpan 
... 
cpan shell -- CPAN exploration and modules installation (v2.10) 
Enter 'h' for help. 

cpan[1]> "install PDF::Create" 
Catching error: "Can't locate object method \"Create\" via package \"install PDF\" (perhaps you forgot to load \"install PDF\"?) ... 

問題是你把引號圍繞整個命令,顯然。

解決方法:去掉引號:

cpan[2]> install PDF::Create 

...正常工作在這裏。

此外,您可以在不輸入cpan shell的情況下執行cpan PDF::Create