2012-02-03 6 views
2

私はいくつかのPerlモジュールをインストールしようとしています。私はPerlのローカルインストールに関する前提条件

を使用して私のローカルディレクトリにSpiffy-0.30をインストールします。その後、私はTest Base-6.0をインストールしようとします.Spiffyは同じコードを使用する前提条件であり、Spiffyが不足していると言います。 Perlに前提条件を探すディレクトリを教える方法はありますか?

+0

'〜/ lib'があなたの' PERL5LIB'パスにあるとすれば、Perlは他のモジュールをインストールするときにそれを見つけることができると思います。そのショットをあげる。 –

+0

〜/ libは作成したディレクトリではありません。作成するディレクトリにインストールする必要がありますので、スクリプトに含めることができます。 – chrstahl89

+0

正確に。あなたが作成して以来、Perlにどこにあるのかを伝える必要があります。私は 'PERL5LIB'環境変数がそうするだろうと思います。 –

答えて

2

~libはPerlモジュールのデフォルトの場所ではないので、Perlモジュールにはどこにあるのかを伝える必要があります。環境変数PERL5LIBでこれを行うことができます。ここに私のUbuntuボックスからの端末出力があります。

[email protected]:~$ mkdir ~/lib 
[email protected]:~$ tar xzf Spiffy-0.30.tar.gz 
[email protected]:~$ cd Spiffy-0.30/ 
[email protected]:~/Spiffy-0.30$ perl Makefile.PL PREFIX=~/lib LIB=~/lib 
Checking if your kit is complete... 
Looks good 
Writing Makefile for Spiffy 
[email protected]:~/Spiffy-0.30$ make 
cp lib/Spiffy.pm blib/lib/Spiffy.pm 
Manifying blib/man3/Spiffy.3pm 
[email protected]:~/Spiffy-0.30$ make test 
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t 
t/autoload.t .. ok 
t/base.t ...... ok  
t/base2.t ..... ok 
t/cascade.t ... ok  
t/const.t ..... ok 
t/early.t ..... ok 
t/export1.t ... ok  
t/export2.t ... ok 
t/export3.t ... ok 
t/export4.t ... ok  
t/export5.t ... ok 
t/export6.t ... ok 
t/export7.t ... ok 
t/exporter.t .. ok 
t/field.t ..... ok 
t/field2.t .... ok 
t/field3.t .... ok 
t/filter.t .... ok 
t/filter2.t ... ok 
t/filter3.t ... ok 
t/filter4.t ... ok 
t/filter5.t ... ok 
t/mixin.t ..... ok  
t/mixin2.t .... ok  
t/mixin3.t .... ok 
t/new.t ....... ok 
t/package.t ... ok 
t/parse.t ..... ok 
t/stub.t ...... ok 
t/super.t ..... ok 
t/super2.t .... ok 
All tests successful. 
Files=31, Tests=198, 2 wallclock secs (0.19 usr 0.30 sys + 0.88 cusr 0.48 csys = 1.85 CPU) 
Result: PASS 
[email protected]:~/Spiffy-0.30$ make install 
Installing /home/standage/lib/Spiffy.pm 
Installing /home/standage/lib/man/man3/Spiffy.3pm 
Appending installation info to /home/standage/lib/x86_64-linux-gnu-thread-multi/perllocal.pod 
[email protected]:~/Spiffy-0.30$ cd .. 
[email protected]:~$ tar xzf Test-Base-0.60.tar.gz 
[email protected]:~$ cd Test-Base-0.60/ 
[email protected]:~/Test-Base-0.60$ perl Makefile.PL PREFIX=~/lib LIB=~/lib 
Checking if your kit is complete... 
Looks good 
Warning: prerequisite Spiffy 0.30 not found. 
Writing Makefile for Test::Base 
[email protected]:~/Test-Base-0.60$ export PERL5LIB=~/lib:$PERL5LIB 
[email protected]:~/Test-Base-0.60$ perl Makefile.PL PREFIX=~/lib LIB=~/lib 
Writing Makefile for Test::Base 
[email protected]:~/Test-Base-0.60$ 
2

モジュールをローカルにインストールする場合は、local::libモジュールをお勧めしますか?これは大部分の頭痛を取り除きます。

関連する問題