3

在更新我的项目时,其中包含以下行Podfile

pod 'UIView-Autolayout', :git => 'https://github.com/dkk/UIView-Autolayout.git'

pod update使用我想更新此 github 存储库中的 pod的命令,该存储库具有以下 podspec:

Pod::Spec.new do |s|
  s.name         = 'UIView-Autolayout'
  s.version      = '0.2.2'
  s.license      = 'MIT'
  s.platform     = :ios, '6.0'

  s.summary      = 'Category on UIView to simplify the creation of common layout constraints.'
  s.homepage     = 'https://github.com/jrturton/UIView-Autolayout'
  s.author       = { 'Richard Turton' => 'jrturton@gmail.com' }
  s.source       = { :git => 'https://github.com/jrturton/UIView-Autolayout.git', :tag => s.version.to_s }

  s.source_files = 'Source/*.{h,m}'

  s.requires_arc = true
end

作为输出,我得到:Installing UIView-Autolayout 0.2.1 (was 0.2.1). 为什么不安装版本0.2.2??

(我的项目是iOS7.0,带ARC)

如果我将Podfile行替换为pod 'UIView-Autolayout', :git => 'https://github.com/dkk/UIView-Autolayout.git', '0.2.2'我收到错误

4

1 回答 1

5

该存储库没有版本标签,0.2.2直到开发人员/贡献者添加标签后才会更新。

Cocoapods 使用这个值:

s.version      = '0.2.2'

通过查找与字符串完全匹配的标签名称。

编辑

源代码还需要指向您的存储库:

s.source       = { :git => 'https://github.com/jrturton/UIView-Autolayout.git', :tag => s.version.to_s }

编辑 2

似乎注释掉 pod(在行首放置一个哈希)并运行 pod install (删除它),然后取消注释并再次运行 pod install 是必要的。

直觉是 pods.lock 文件缓存了一些东西,不想切换到同一个库的新仓库。

于 2015-05-06T13:11:08.690 回答