修复cocoapods - Unable to satisfy the following requirements:

本文介绍了解决CocoaPods更新时遇到版本冲突的问题。通过删除本地缓存并重新设置来修复无法更新到最新版本的情况。

修复cocoapods

2014-12-21

在拉下松爷更新的Podfile后,尝试用pod update更新,结果出现下面错误

$pod update
Update all pods
Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `JSQMessagesViewController (~> 6.1.0)` required by `Podfile`

没什么头绪,尝试查一下版本

$pod list | grep JSQM
  JSQMessagesViewController 6.0.0

JSQMessagesViewController主页明明标了已经是6.1.1,是不是版本库有本地缓存,在pod --help加google下,发现命令pod repo update,果断运行一下,卡住,加上–verbose

$pod repo update --verbose
  $ /usr/bin/git rev-parse  >/dev/null 2>&1

Updating spec repo `master`
  $ /usr/bin/git pull --ff-only
  error: Your local changes to the following files would be overwritten by merge:
  	CocoaPods-version.yml
  	Specs/AdMobMediationAdapterMMedia/1.5.0/AdMobMediationAdapterMMedia.podspec.json
  Please, commit your changes or stash them before you can merge.
  error: The following untracked working tree files would be overwritten by merge:
  	Specs/AAShareBubbles/1.1.0/AAShareBubbles.podspec.json
  	...[略去n行]
  	Specs/AQSEvent/0.2.0/AQSE
  Aborting
  Updating da90008..86016e3

[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`

果然本地有缓存,还是git管理的,更新时冲突,google了一下,找到相关资料:
1.http://stackoverflow.com/questions/19477178/cocoapods-error-during-pod-update
2.http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/

解决方法:删除本地缓存,重新setup

$rm -fr ~/.cocoapods/repos/master
$pod setup

转载:http://yongyao.li/blog/article/repair-broken-cocoapods-specs-repository
+] Starting database [+] Creating database user 'msf' 为新角色输入的口令: 再输入一遍: [+] Creating databases 'msf' ┏━(Message from Kali developers) ┃ ┃ We have kept /usr/bin/python pointing to Python 2 for backwards ┃ compatibility. Learn how to change this and avoid this message: ┃ ⇒ https://www.kali.org/docs/general-use/python3-transition/ ┃ ┗━(Run “touch ~/.hushlogin” to hide this message) [+] Creating databases 'msf_test' ┏━(Message from Kali developers) ┃ ┃ We have kept /usr/bin/python pointing to Python 2 for backwards ┃ compatibility. Learn how to change this and avoid this message: ┃ ⇒ https://www.kali.org/docs/general-use/python3-transition/ ┃ ┗━(Run “touch ~/.hushlogin” to hide this message) [+] Creating configuration file '/usr/share/metasploit-framework/config/database.yml' [+] Creating initial database schema Traceback (most recent call last): 15: from /usr/bin/bundle:25:in `<main>' 14: from /usr/lib/ruby/vendor_ruby/rubygems.rb:289:in `activate_bin_path' 13: from /usr/lib/ruby/vendor_ruby/rubygems.rb:289:in `synchronize' 12: from /usr/lib/ruby/vendor_ruby/rubygems.rb:291:in `block in activate_bin_path' 11: from /usr/lib/ruby/vendor_ruby/rubygems.rb:234:in `finish_resolve' 10: from /usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:425:in `resolve_current' 9: from /usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:413:in `resolve' 8: from /usr/lib/ruby/vendor_ruby/rubygems/resolver.rb:186:in `resolve' 7: from /usr/lib/ruby/vendor_ruby/rubygems/vendor/molinillo/lib/molinillo/resolver.rb:43:in `resolve' 6: from /usr/lib/ruby/vendor_ruby/rubygems/vendor/molinillo/lib/molinillo/resolution.rb:182:in `resolve' 5: from /usr/lib/ruby/vendor_ruby/rubygems/vendor/molinillo/lib/molinillo/resolution.rb:254:in `process_topmost_state' 4: from /usr/lib/ruby/vendor_ruby/rubygems/vendor/molinillo/lib/molinillo/resolution.rb:682:in `attempt_to_activate' 3: from /usr/lib/ruby/vendor_ruby/rubygems/vendor/molinillo/lib/molinillo/resolution.rb:297:in `unwind_for_conflict' 2: from /usr/lib/ruby/vendor_ruby/rubygems/vendor/molinillo/lib/molinillo/resolution.rb:297:in `tap' 1: from /usr/lib/ruby/vendor_ruby/rubygems/vendor/molinillo/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict' /usr/lib/ruby/vendor_ruby/rubygems/vendor/molinillo/lib/molinillo/resolution.rb:317:in `raise_error_unless_state': Unable to satisfy the following requirements: (Gem::Molinillo::VersionConflict) - `bundler (= 2.6.7)` required by `user-specified dependency` 13: from /usr/bin/bundle:25:in `<main>' 12: from /usr/lib/ruby/vendor_ruby/rubygems.rb:289:in `activate_bin_path' 11: from /usr/lib/ruby/vendor_ruby/rubygems.rb:289:in `synchronize' 10: from /usr/lib/ruby/vendor_ruby/rubygems.rb:291:in `block in activate_bin_path' 9: from /usr/lib/ruby/vendor_ruby/rubygems.rb:234:in `finish_resolve' 8: from /usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:425:in `resolve_current' 7: from /usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:413:in `resolve' 6: from /usr/lib/ruby/vendor_ruby/rubygems/resolver.rb:187:in `resolve' 5: from /usr/lib/ruby/vendor_ruby/rubygems/resolver.rb:189:in `rescue in resolve' 4: from /usr/lib/ruby/vendor_ruby/rubygems/resolver.rb:189:in `raise' 3: from /usr/lib/ruby/vendor_ruby/rubygems/resolver.rb:189:in `exception' 2: from /usr/lib/ruby/vendor_ruby/rubygems/exceptions.rb:55:in `initialize' 1: from /usr/lib/ruby/vendor_ruby/rubygems/exceptions.rb:61:in `conflicting_dependencies' /usr/lib/ruby/vendor_ruby/rubygems/resolver/conflict.rb:48:in `conflicting_dependencies': undefined method `request' for nil:NilClass (NoMethodError) ┌──(kali㉿kali)-[~] └─$ 为什么会这样
最新发布
12-04
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值