cocoapods 没有正确更新存储库

cocoapods not updating a repository correctly

更新我的项目时,在 Podfile:

中包含这一行
pod 'UIView-Autolayout', :git => 'https://github.com/dkk/UIView-Autolayout.git'

使用命令 pod update 我想更新 the pod in this github repository,它具有以下 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)

如果我用 pod 'UIView-Autolayout', :git => 'https://github.com/dkk/UIView-Autolayout.git', '0.2.2' 替换 Podfile 行,我会得到一个错误

该回购没有版本标签 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 文件缓存了一些东西,不想切换到同一个库的新存储库。