Can't locate Git.pm in @INC

前端 未结 6 1052
暖寄归人
暖寄归人 2021-01-17 10:16

When I run git add -p, I see:

Can\'t locate Git.pm in @INC (@INC contains:
/usr/local/lib/perl5/site_perl
/Library/Perl/5.12/darwin-thread-multi-2lev         


        
相关标签:
6条回答
  • 2021-01-17 10:18

    It can be fixed via SymLink. I just couldn't be asked to do that, but instead I reinstall git using brew uninstall git and brew install git, which does the trick for me.

    0 讨论(0)
  • 2021-01-17 10:23

    Git.pm is usually shipped as part of your Git installation, not as part of Perl.

    As a result, it will be located somewhere relative to the git program. Try looking in a lib directory nearby whatever the output of which git is. For example, if which git returns /opt/local/bin/git the try looking under the directory /opt/local/lib, etc.

    0 讨论(0)
  • 2021-01-17 10:25

    On OSX (and Homebrew) I fixed this by simply reinstalling:

    $ brew uninstall git
    $ brew install git
    
    0 讨论(0)
  • 2021-01-17 10:25

    I met the same issue on my Mac OS 10.9.4, and fixed it with the following command:

    $ sudo ln -s /Library/Developer/CommandLineTools/usr/share/git-core /usr/share/
    
    0 讨论(0)
  • 2021-01-17 10:34

    I had the same issue.

    Finally I had resolved it by installing git from source and having my installation in my PATH rather the one from XCode.

    0 讨论(0)
  • 2021-01-17 10:44

    On macOS Mojave, git perl lib is in /Library/Developer/CommandLineTools/usr/share/git-core/perl. So, it can be fixed by:

    export PERLLIB=/Library/Developer/CommandLineTools/usr/share/git-core/perl:$PERLLIB
    
    0 讨论(0)
提交回复
热议问题