2014-12-04 72 views
16

我想使用私有倉庫打破了更大的應用程序。我遵循的指南:的CocoaPods:無法找到[PrivateSpec]規範依賴於由[PrivateClientSpec]

我創建了一個本地資源庫包含的規格,通過發佈到的CocoaPods(類似,但不同的問題)

pod remote add MySpecs ~/local/path/to/MySpecs.git,

證實的CocoaPods由內PrivateClientSpec望着~/.cocoapods/repos/MySpecs

我已經提到PrivateSpec內容如下看見他們:

s.dependency 'PrivateSpec' '~> 0.1.0'

的問題是,當我嘗試皮棉這個PrivateClientSpec,我得到名義的錯誤:

Unable to find a specification for [PrivateSpec] depended upon by [PrivateClientSpec]

上午我米西什麼東西?據我所知,這是支持的行爲。我正在使用cocoapods v0.35。

謝謝!

+0

我的lint在添加--sources之後通過,但在Example項目上實際的pod安裝失敗。任何想法? – 2015-12-11 03:40:42

回答

32

的原因是pod spec棉短絨只檢查主規格,所以它不能找到你的私人之一。

你需要使用--sources選項,如:

pod spec lint --sources='[email protected]:iOS/Specs.git,https://github.com/CocoaPods/Specs' 

兩件事兩注:

  • 您的私人規格需要在線,在本地無法檢查一個
  • 如果你依靠你需要添加的網址爲他們的規格回購過其他吊艙,這就是爲什麼在這個例子中,我們有過https://github.com/CocoaPods/Specs

通過運行pod spec lint --help你可以閱讀更多有關此選項:

--sources=https://github.com/artsy/Specs The sources from which to pull 
              dependant pods (defaults to 
              https://github.com/CocoaPods/Specs.git). 
              Multiple sources must be 
              comma-delimited. 

更多關於此herehere

+0

'lint --sources ='git @ our-private-spec-repo:iOS/Specs.git,https:// github.com/CocoaPods/Specs'' not working pod v0.39.0 – 2015-11-05 09:38:40

+1

這適用於lint,但是如何在父開發窗口的Example項目上安裝實際的窗口? – 2015-12-11 03:41:10

+0

截至最新版本的'CocoaPods'('1.0.1'),你可以在不使用在線規格的情況下運行:'pit lib lint --sources ='git @ our-private-spec-repo:iOS/Specs .git,https://github.com/CocoaPods/Specs'--private' – 2016-09-20 21:05:56

0

如果mokagio的回答沒有工作的人,這裏是什麼工作我:

只需將私人回購網址更改爲https://

pod spec lint --sources='https://our-private-spec-repo:iOS/Specs.git,https://github.com/CocoaPods/Specs' 
0

爲了pod install才能正常工作我還有補充:

source '<Prive specs lib URL>' 
source 'https://github.com/CocoaPods/Specs.git' 

..to莢文件(不podspec)。

爲了擺脫:

Unable to find a specification for [PrivateSpec] depended upon by [PrivateClientSpec]

2

爲了pod install才能正常工作我還有補充:

source '<Prive specs lib URL>' 
source 'https://github.com/CocoaPods/Specs.git' 

..to莢文件(不podspec)。

爲了擺脫:

Unable to find a specification for [PrivateSpec] depended upon by [PrivateClientSpec]

如果您還失敗,錯誤安裝這樣

pod install --verbose 

    Preparing 

Re-creating CocoaPods due to major version update. 
    - Running source provider hooks 
https://github.com/CocoaPods/Specs.git 
<Prive specs lib URL> 
source_url <Prive specs lib URL> 

Analyzing dependencies 

Inspecting targets to integrate 
    Using `ARCHS` setting to build architectures of target `Pods-YourTarget`: (``) 

Finding Podfile changes 
    XXXXXXXXXXXXXXX 

Resolving dependencies of `Podfile` 

――― MARKDOWN TEMPLATE ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 

### Command 

``` 
/usr/local/bin/pod install --verbose 
``` 

### Report 

* What did you do? 

* What did you expect to happen? 

* What happened instead? 


### Stack 

``` 
    CocoaPods : 1.1.1 
     Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16] 
    RubyGems : 2.6.10 
     Host : Mac OS X 10.12.4 (16E195) 
     Xcode : 8.3.2 (8E2002) 
     Git : git version 2.11.0 (Apple Git-81) 
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib 
Repositories : alibaba-specs - @ fatal: Not a git repository (or any of the parent directories): .git 
       aliyun - [email protected]:aliyun/aliyun-specs.git @ 7406176b51b4d4f8f323a39f4d96a3857229805d 
       aliyun-1 - <Prive specs lib URL> @ 7406176b51b4d4f8f323a39f4d96a3857229805d 
       master - https://github.com/CocoaPods/Specs.git @ 86c330635113e7fc290fdebad4ba3ed0dca2daee 
       taobao-baichuansdk-alibcspecs - http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git @ e8cb2ae2ee7f44582923e4fae29243d6225fa8ee 
``` 

### Plugins 

``` 
cocoapods-deintegrate : 1.0.1 
cocoapods-plugins  : 1.0.0 
cocoapods-repo-alirsync : 1.0.4 
cocoapods-repo-rsync : 1.0.4 
cocoapods-search  : 1.0.0 
cocoapods-stats   : 1.0.0 
cocoapods-trunk   : 1.2.0 
cocoapods-try   : 1.1.0 
``` 

### Podfile 

```ruby 
# Uncomment this line to define a global platform for your project 
# platform :ios, '8.0' 
# Uncomment this line if you're using Swift 
# use_frameworks! 


source 'https://github.com/CocoaPods/Specs.git' 
source '<Prive specs lib URL>' 


target 'YourTarget' do 
    pod 'AlicloudFeedback', ‘~> 3.0.1’ 
end 
``` 

### Error 

``` 
RuntimeError - Cannot initialize an aggregate with a nil source: ([nil]) 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/source/aggregate.rb:13:in `initialize' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:356:in `new' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:356:in `aggregate_for_dependency' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:347:in `create_set_from_sources' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:317:in `find_cached_set' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:290:in `specifications_for_dependency' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:108:in `search_for' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:206:in `block in sort_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:200:in `each' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:200:in `sort_by' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:200:in `sort_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.7/lib/molinillo/delegates/specification_provider.rb:52:in `block in sort_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.7/lib/molinillo/delegates/specification_provider.rb:69:in `with_no_such_dependency_error_handling' 
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.7/lib/molinillo/delegates/specification_provider.rb:51:in `sort_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.7/lib/molinillo/resolution.rb:165:in `initial_state' 
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.7/lib/molinillo/resolution.rb:106:in `start_resolution' 
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.7/lib/molinillo/resolution.rb:64:in `resolve' 
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.7/lib/molinillo/resolver.rb:42:in `resolve' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:62:in `resolve' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:723:in `block in resolve_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/user_interface.rb:64:in `section' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:721:in `resolve_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:76:in `analyze' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:236:in `analyze' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:150:in `block in resolve_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/user_interface.rb:64:in `section' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:149:in `resolve_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:110:in `install!' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command/install.rb:37:in `run' 
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:50:in `run' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/bin/pod:55:in `<top (required)>' 
/usr/local/bin/pod:22:in `load' 
/usr/local/bin/pod:22:in `<main>' 
``` 

――― TEMPLATE END ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 

[!] Oh no, an error occurred. 

Search for existing GitHub issues similar to yours: 
https://github.com/CocoaPods/CocoaPods/search?q=Cannot+initialize+an+aggregate+with+a+nil+source%3A+%28%5Bnil%5D%29&type=Issues 

If none exists, create a ticket, with the template displayed above, on: 
https://github.com/CocoaPods/CocoaPods/issues/new 

Be sure to first read the contributing guide for details on how to properly submit a ticket: 
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md 

Don't forget to anonymize any private data! 

Looking for related issues on cocoapods/cocoapods... 
- Changes search index format to fasten `pod search --full` command. 
    https://github.com/CocoaPods/CocoaPods/pull/4249 [closed] [33 comments] 
    28 Oct 2015 


[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice. 

那麼你應該嘗試更新您的CocoaPods版本。這可能對你有所幫助:https://stackoverflow.com/a/39973232/3395008

相關問題