Pod安装私有pods URI :: InvalidURIError - 错误的URI(不是URI?)

时间:2014-10-29 21:59:03

标签: ios ruby git gem cocoapods

我在gitlab上使用私有pod和其他公共pod有一个git repo,下面是我的Podfile

source 'git@gitlab.mycompany.com:cocoapods/cocoapodsspecs.git'
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '6.0'

target "main-project-target" do
    ....
end

我在10.10 Yosemite上都有2个mac,我在gitlab上克隆我的项目,然后进行pod安装以获取库。

第一个配置如下:

CocoaPods : 0.34.4
Ruby : ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-darwin13.3.0]
RubyGems : 2.1.9
Host : Mac OS X 10.10 (14A389)
Xcode : 6.1 (6A1052d) 
Git : git version 1.9.3 (Apple Git-50) 
Ruby lib dir : /Users/a-user/.rvm/rubies/ruby-2.0.0-p481/lib 
Repositories : my-project - git@gitlab.mycompany.com:cocoapods/cocoapodsspecs.git @4fff1c9692486e603edf643013f1136a762cdcdf
master - https://github.com/CocoaPods/Specs.git @ c9acfa46c81ffa93063a56d342afa7c0de71c345

它可以毫无问题地进行pod安装,包括我的私有pod在内的所有库都安装得很好。

我的第二个mac是新的,我无法成功安装pod,一开始我以为这是系统默认的ruby的问题,所以我用自制软件安装ruby,下面是配置:

CocoaPods : 0.34.4
    Ruby : ruby 2.0.0p594 (2014-10-27 revision 48167) [x86_64-darwin14.0.0]
RubyGems : 2.4.2
    Host : Mac OS X 10.10 (14A389)
   Xcode : 6.1 (6A1052d)
     Git : git version 2.1.2
Ruby lib dir : /Users/a-user/.rvm/rubies/ruby-2.1.4/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 2a7c343fc975097c436c080765b736aefa5e2629

显然可可豆荚找不到我的私人吊舱,错误信息是:

### Error

```
URI::InvalidURIError - bad URI(is not URI?):git@gitlab.mycompany.com:cocoapods/cocoapodsspecs.git

我还尝试安装ruby 2.0.0以与我的旧mac保持一致,但我收到了相同的消息。

PS:我可以毫无问题地克隆我的私人git库。

我在GitHub的Cocoapods问题上搜索了很多,比如https://github.com/CocoaPods/Core/issues/82,但没有发现与我的情况类似。

感谢任何帮助。提前谢谢

1 个答案:

答案 0 :(得分:1)

我找到解决方案,只需将私人仓库添加到Pods帮助:

pod repo add my-repo git@gitlab.mycompany.com:cocoapods/cocoapodsspecs.git

它确实与无效的url无关,错误消息非常具有误导性。希望能有所帮助