使用cocospod报错Unable to satisfy the following requirements解决方案

本文介绍了一种在使用Cocoapods安装MJExtension时遇到的错误及解决方法。原因是Podfile文件中指定的第三方库版本过旧,通过使用pod update命令更新到了最新版本解决问题。

今天从git上面download我们项目,然后向往常一样安装Cocoapods,但是却突然发现报错了,尝试了几遍,发现一直报错。然后我这才看了一下,安装Cocoapods的日志,发现抛出了一个报错。

技术分享

[!] Unable to satisfy the following requirements:


- `MJExtension` required by `Podfile`
- `MJExtension (= 2.4.4)` required by `Podfile.lock`

              哎,之前没有见过这个错误,我不知道从何着手解决这个问题。然后,开始使用我们程序员的神器,就是Google啦。很难想象如果没有Google,多少程序员要丢饭碗。看到了一个博客分享了自己的解决方案,如下:


因此我们要用pod命令进行安装。cd到Example目录下执行pod install命令,将会报错:

[plain]  view plain copy 技术分享 技术分享
  1. $ pod install  
  2. Analyzing dependencies  
  3. Fetching podspec for `UAAppReviewManager` from `..`  
  4. [!] Unable to satisfy the following requirements:  
  5. - `UAAppReviewManager (from `..`)` required by `Podfile`  


原因是要添加的类库已经有最新版本推出,而Podfile文件并没有更改其下载版本(Podfile文件过期),于是获取安装数据失败。

因此我们要用update命令获取最新版本的类库:

[plain]  view plain copy 技术分享 技术分享
  1. $ pod update  
  2. Analyzing dependencies  
  3. Fetching podspec for `UAAppReviewManager` from `..`  
  4. Downloading dependencies  
  5. Installing UAAppReviewManager (0.2.1)  
       
            由此可知,出现这个错误的原因是,我本地Podfile文件上的MJExtension第三方版本太低。解决方案就是,更新一下本地Podfile文件上的MJExtension第三方版本,也就是pod update --verbose一下。注意一下,这个命令需要很长时间。一直停在这个页面。。。。


zuodeMacBook-Air:mokodreamwork_ios2 zuo$ pod update --verbose Update all pods
  Preparing


Updating local specs repositories


Updating spec repo `master`
    
     大家千万不要关掉页面,等半个小时吧,就会更新好。如下界面:

技术分享技术分享

       表示更新成功,问题也解决了,然后就可以打开我们从git上面download的工程了。
         本文参考资料

+] 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 ~/.hushloginto 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 ~/.hushloginto 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、付费专栏及课程。

余额充值