git svn 错误 Can't locate SVN/Core.pm 的解决方案

3 篇文章 0 订阅
2 篇文章 0 订阅

【错误场景】

组里面要把代码从svn服务器里整体迁移到git上,准备两步走。
第一步,用 git svn转换成git仓库,
第二步,把git仓库提交到git服务器上。
本来是很快乐的事情,然而勇者在买装备的时候遇到了麻烦,在git svn的时候出错了。魔王只能再等我一会了。

操作系统

[counsellor@localhost git]$ cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core)

git版本

[counsellor@localhost git]$ git --version
git version 2.12.0

svn版本

[counsellor@localhost git]$ svn --version
svn, version 1.9.4 (r1740329)
   compiled Jul 14 2016, 12:41:14 on x86_64-redhat-linux-gnu

perl版本

[counsellor@localhost git]$ perl --version

This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 29 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

错误提示

cmd> git svn clone https://svn.xxxxxx.com/svn/myrepo --username=admin --no-metadata --authors-file=users.txt   myrepo

Can't locate SVN/Core.pm in @INC (@INC contains: /usr/local/share/perl5 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/share/perl5/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/share/perl5/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/share/perl5/Git/SVN.pm line 32.
BEGIN failed--compilation aborted at /usr/local/share/perl5/Git/SVN.pm line 32.
Compilation failed in require at /usr/local/libexec/git-core/git-svn line 21.
BEGIN failed--compilation aborted at /usr/local/libexec/git-core/git-svn line 21.

【解决方案】

yum install subversion-perl

【问题分析】

先找到报错的第一现场:

/usr/local/share/perl5/Git/SVN/Utils.pm line 6

看代码:

package Git::SVN::Utils;

use strict; 
use warnings;

use SVN::Core;

可以看到是use SVN::Core;调用svn模块时,perl代码提示找不到svn模块。所以说明perl里没有svn相关的库,安装即可。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值