CocoaPods报错Unable to satisfy the following requirements

本文详细记录了从Swift 1.2版本项目升级至Swift 2.0并集成iOS 9环境时,遇到的CocoaPods安装错误及解决过程。从错误日志分析入手,逐步排查并成功解决依赖库Alamofire升级时的配置问题。

前言:今天一时兴起,想接着做之前做的一个Swift的小项目有,打开xcode发现已经是7.0.1的版本号了,集成了iOS9和swift2.0,可想而知,之前基于swift1.2版本的代码又需要修改才能编译通过了哦。

不光是自己写的代码,连引入的第三方库也需要升级,比如网络请求神器Alamofire,在github上搜索Alamofire,看到大神已经更新的版本支持最新的swift和xcode了,果然是大神。按照github文档中的

pod 'Alamofire', '~> 2.0'

 加入到Podfile中,执行

pod install --verbose --no-repo-update

 果然,报错了,唉。。。程序员就是要和无限的bugs做斗争,起来找原因了。。。

Preparing

Analyzing dependencies

Inspecting targets to integrate
xcrun: error: unable to find utility "xcode-select", not a developer tool or in PATH
  Using `ARCHS` setting to build architectures of target `Pods`: (``)

Resolving dependencies of `Podfile`
[!] Unable to satisfy the following requirements:

- `Alamofire (~> 2.0)` required by `Podfile`

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/resolver.rb:411:in `handle_resolver_error'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/resolver.rb:69:in `rescue in resolve'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/resolver.rb:57:in `resolve'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/installer/analyzer.rb:539:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/user_interface.rb:59:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/installer/analyzer.rb:537:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/installer/analyzer.rb:70:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/installer.rb:213:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/installer.rb:136:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/user_interface.rb:59:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/installer.rb:135:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/installer.rb:105:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/command/project.rb:101:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/lib/cocoapods/command.rb:47:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.5/bin/pod:44:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

 

+] 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值