mac下sourcetree下载使用安装svn

mac下sourcetree下载使用安装svn

直接使用sourcetree clone svn的代码,会报错。

报错代码如下:

Can't locate SVN/Core.pm in @INC (you may need to install   the SVN::Core module) (@INC contains:   /usr/local/git/lib/perl5/site_perl   /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.18.2   /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl /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.2 /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 .) at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.

BEGIN failed--compilation aborted at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.

Compilation failed in require at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN.pm line 26.

BEGIN failed--compilation aborted at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN.pm line 33.

Compilation failed in require at /Applications/SourceTree.app/Contents/Resources/git_local/libexec/git-core/git-svn line 25.

解决办法

下载xcode

之后 在命令提示行 输入

xcode-select --install

选择安装 等5-6分钟就好了

这时候sourcetree还是不行 需要继续在命令提示行 输入

sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/SVN /System/Library/Perl/Extras/5.18/SVN
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/auto/SVN//System/Library/Perl/Extras/5.18/auto/SVN

报错以及解决办法

报错提示

ln: /System/Library/Perl/Extras/5.18/SVN: Operation not permitted

解决办法

El Capitan加入了Rootless机制,不再能够随心所欲的读写很多路径下了。设置root权限也不行。

Rootless机制将成为对抗恶意程序的最后防线
于是尝试关闭Rootless。重启按住 Command+R,进入恢复模式,打开Terminal

csrutil disable

重启即可。如果要恢复默认,那么

csrutil enable

发表评论

电子邮件地址不会被公开。 必填项已用*标注