xxo*_*mmd 6 macos perl git-svn
最近我重新安装了macOS Catalina 10.15.4. 安装后Command_Line_Tools_11.4.1,它告诉我 svn 不再使用 Xcode。然后我通过 brew 安装了 git 和 svn,希望 git-svn 可以工作。不幸的是收到此错误消息:
无法在@INC 中找到 SVN/Core.pm(您可能需要安装 SVN::Core 模块)(@INC 包含:/usr/local/Cellar/git/2.26.2/share/perl5 /Applications/Xcode .app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18/darwin-thread -multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl /5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) 在 / usr/local/Cellar/git/2.26.2/share/perl5/Git/SVN/Utils.pm 第 6 行。
git 和 svn 都是最新版本。
请帮帮我。
xxo*_*mmd 24
我终于明白了!!!
打开git-svn文件(perl 脚本,在我的例子中文件位置是/usr/local/opt/git/libexec/git-core/git-svn),将第一行更改#!/usr/bin/perl为#!/usr/local/bin/perl
它有效!
我猜系统 perl 不包括 perl SVN/Core,但 brew perl 有它(brew svn 的依赖)。
适用于 MacOS Big Sur 11.5 的解决方案
在与这个错误斗争了几个小时之后:
Can't locate SVN/Core.pm in @INC (you may need to install the SVN::Core module)
Run Code Online (Sandbox Code Playgroud)
我终于找到了一个真正有效的解决方案。
如果你运行:
brew reinstall subversion
Run Code Online (Sandbox Code Playgroud)
它会打印这样的消息:
The perl bindings are located in various subdirectories of:
/usr/local/opt/subversion/lib/perl5
Run Code Online (Sandbox Code Playgroud)
然后你只需要在使用之前运行此命令git svn从正确的路径加载SVN模块:
export PERL5LIB=/usr/local/opt/subversion/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level
Run Code Online (Sandbox Code Playgroud)
对于像我一样想要在 macOS Catalina 上通过 git-svn 使用 Sourcetree 客户端的人的解决方案:
第一步:
brew install git
brew install perl
brew install subversion
edit
/usr/local/Cellar/git/git_version/libexec/git-core/git-svn
replace
#!/usr/bin/perl
with
#!/usr/local/bin/perl
Run Code Online (Sandbox Code Playgroud)
第二步,安装缺少的 perl 模块:
cpan SVN::Core
cpan Term::ReadKey
Run Code Online (Sandbox Code Playgroud)
第三步,配置SourceTree:
在 Sourcetree->Preferences - 设置选项“use system git”,来自:
/usr/local/Cellar/git/git_version/git
Run Code Online (Sandbox Code Playgroud)