0

私はそれが働いていると思った。

私は Perl 5.16 の完全にプライベートなバージョン (プライベートとは、ホーム ディレクトリに対してローカルであることを意味します) と、CPAN モジュール用のプライベートな場所を持っています。私はhttp://blog.fox.geek.nz/2010/09/installing-multiple-perls-with.htmlの指示に従いました(少し古くなっているので調整します)。 local::lib. 上記の instrux がインストールした cpanm を使用して、Cache::Memcached::Fast.pm をインストールし、このモジュールを使用する Perl プログラムを正常に実行しました。

今日は機能していません。

Can't locate Cache/Memcached/Fast.pm in @INC (@INC contains:     
/Users/chap/perl5/perlbrew/perls/perl-5.16.1/lib/site_perl/5.16.1/darwin-2level
/Users/chap/perl5/perlbrew/perls/perl-5.16.1/lib/site_perl/5.16.
/Users/chap/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1/darwin-2level
/Users/chap/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1 .) at ./memget line 11.

いくつかのトラブルシューティング:

/Users/chap$ perlbrew use
Currently using perl-5.16.1

...甘い。

/Users/chap$ which perl
/Users/chap/perl5/perlbrew/perls/perl-5.16.1/bin/perl

...驚くばかり。

/Users/chap$ perlbrew switch perl-5.16.1
/Users/chap$ cpanm --interactive -v App::cpanoutdated
cpanm (App::cpanminus) 1.5014 on perl 5.012004 built for darwin-thread-multi-2level
Work directory is /Users/chap/.cpanm/work/1350175791.76873
You have make /usr/bin/make
You have LWP 6.03
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching App::cpanoutdated on cpanmetadb ...
!
! Can't write to /Library/Perl/5.12 and /usr/local/bin: Installing modules to /Users/chap/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /Library/Perl/5.12 and /usr/local/bin)
!   - Configure local::lib your existing local::lib in this shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
Checking if you have ExtUtils::MakeMaker 6.31 ... Yes (6.62)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.55)
App::cpanoutdated is up to date. (0.23)

ええとああ。なぜシステム Perl なのか???

4

2 に答える 2

1

cpanm実行可能ファイルのソースコードを確認することをお勧めします。

cpanmコマンドにのシバンが含まれている可能性があります#!/usr/bin/perl。この場合、perlbrew switchまたはperlbrew usecpanmコマンドを呼び出すためにperlのバージョンを変更することはできません。(もちろん、いつものように実行しない限りperl /usr/bin/cpanm

によってインストールを行う場合、curl -o cpanm http://cpanmin.usまたはを含む必要がある場合は、動的に切り替えることができるperlbrew install-cpanmというシバンが含まれている必要があります。/usr/bin/env perl

于 2012-10-18T06:27:34.467 に答える
1

ステップ 6 (perl ごとに 'cpanm' をセットアップする) をスキップしたか間抜けだった場合は、以前にシステム perl と共にインストールされた cpanm を実行している可能性があるため、システム ディレクトリに書き込みたいと考えています。

perlbrew の最近のバージョンには、perl の外部の特別な場所に cpanm をインストールする「install-cpanm」コマンドがあります。そうすれば、作成する perl ごとに cpanm をインストールする必要はありません。これはあなたが必要とするものかもしれません。

于 2012-10-17T06:48:12.763 に答える