ios - Pod install private pods URI::InvalidURIError - 错误的 URI(不是 URI?)

标签 ios ruby git gem cocoapods

我在 gitlab 上有一个 git repo,使用私有(private) pod 和其他公共(public) pod,下面是我的 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 install 以获取库。

第一个的配置如下:

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 安装,包括我的私有(private) pod 在内的所有库都已安装好。

我的第二台mac是新的,安装pod安装不成功,一开始以为是系统默认ruby的问题,于是用homebrew安装了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

很明显cocoa pods没有找到我的private pod,报错信息是:

### Error

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

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

PS:我可以毫无问题地克隆我的私有(private) git 库。

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

感谢任何帮助。提前谢谢你

最佳答案

我找到了解决方案,只需将私有(private)仓库添加到 Pods 即可:

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

它确实与无效 url 无关,错误消息具有误导性。希望能帮到你

关于ios - Pod install private pods URI::InvalidURIError - 错误的 URI(不是 URI?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26641389/

相关文章:

ios - 与 NSExtensionJavaScriptPreprocessingFile 共享扩展无图像

ios - 副标题 TableView 单元格

ruby-on-rails - 如何对哈希的分层数组进行排序

git - 如何将 Git 配置为在分支更改时自动从原点 pull ?

ios - 通过应用内购买合并付费应用和免费应用

ios - Xcode/IOS 代码可见性

php - 在 Ruby 中解密 PHP MCRYPT_RIJNDAEL_256

ruby-on-rails - 在哪里可以找到 ActiveRecord_Relation 的 `present?` 方法的文档

git - 一种验证 .gitignore 文件的方法

Git GUI/TortoiseGit 没有调用正确使用 powershell 的 Hook ? ( window )