git checkout --patch,但失败了,无法在@INC中找到Git.pm

时间:2014-11-28 08:12:17

标签: linux git perl cpan

当我运行git checkout --patch origin / master file.java时,我看到:

Can't locate Git.pm in @INC (you may need to install the Git module) 
(@INC contains: 
/usr/share/perl/5.14.2 
/usr/local/perl/lib/site_perl/5.20.0/x86_64-linux 
/usr/local/perl/lib/site_perl/5.20.0 
/usr/local/perl/lib/5.20.0/x86_64-linux /usr/local/perl/lib/5.20.0 .) 
at /usr/lib/git-core/git-add--interactive line 7.
BEGIN failed--compilation aborted at /usr/lib/git-core/git-add--interactive line 7.

我在Ubuntu 12.04.4 LTS上运行它。 git的版本是1.7.9.5。 perl是perl5,版本20,颠覆0(v5.20.0)为x86_64-linux构建。

1 个答案:

答案 0 :(得分:1)

/usr/share/perl5/Git.pm中可能缺少

PATH(或类似情况,具体取决于系统)。

export PERL5LIB=/usr/share/perl5添加到~/.bashrc文件可以解决问题。