Mac OS X 10.10(yosemite)更新后,cocoapods出错, 及cocoapods更新至0.34后, 错误情况整理

本文解决Mac OS升级到10.10后使用CocoaPods安装依赖时出现的错误,包括卸载特定版本插件并更新CocoaPods,及调整Podfile格式以适配新版本。

1:Mac升级10.10后,执行pod install出错如下

1
2
3
4
5
6
7
8
9
10
11
QTX-Will-mini:NewHishop willbin$ pod install
[!] Unable to load a specification for  the plugin `/Library/Ruby/Gems/2.0.0/gems/cocoapods- try -release-fix-0.1.2`
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/user_interface/error_report.rb:13:in `report': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
     from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command.rb:63:in `report_error'
     from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:300:in `handle_exception'
     from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:274:in `rescue in run'
     from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:264:in `run'
     from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command.rb:50:in `run'
     from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/bin/pod:33:in `<top (required)>'
     from /usr/bin/pod:23:in `load'
     from /usr/bin/pod:23:in `<main>'

  解决方案:卸载0.1.2版本, 再安装最新版本

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
QTX-Will-mini:NewHishop willbin$ sudo gem uninstall cocoapods- try -release-fix
Password:
 
Select gem to uninstall:
  1. cocoapods- try -release-fix-0.1.1
  2. cocoapods- try -release-fix-0.1.2
  3. All versions
 
> 3
 
Successfully uninstalled cocoapods- try -release-fix-0.1.1
Successfully uninstalled cocoapods- try -release-fix-0.1.2
 
   
QTX-Will-mini:NewHishop willbin$ sudo gem install cocoapods
Successfully installed cocoapods-0.34.4
Parsing documentation for  cocoapods-0.34.4
1 gem installed

  

 

2:安装成功后, 再执行 pod install 还是出错, 如下

1
2
3
4
5
6
7
8
9
10
QTX-Will-mini:NewHishop willbin$ pod install
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/user_interface/error_report.rb:13:in `report': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
     from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command.rb:63:in `report_error'
     from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:300:in `handle_exception'
     from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:274:in `rescue in run'
     from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:264:in `run'
     from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command.rb:50:in `run'
     from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/bin/pod:33:in `<top (required)>'
     from /usr/bin/pod:23:in `load'
     from /usr/bin/pod:23:in `<main>'

  解决方案: podfile格式变化了. 要用新格式.

 

3: podfile格式变化

以前的podfile格式如下

1
2
platform :ios, '7.0'
pod 'AFNetworking'

 

 

以下是官网的podfile介绍

http://guides.cocoapods.org/syntax/podfile.html

http://guides.cocoapods.org/using/the-podfile.html

 

 

The Podfile is a specification that describes the dependencies of the targets of one or more Xcode projects. The Podfile always creates an implicit target, named default, which links to the first target of the user project.

A podfile can be very simple:

1
2
pod 'AFNetworking' , '~> 1.0'

  

An example of a more complex podfile can be:

 

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
platform :ios, '6.0'
inhibit_all_warnings!
 
xcodeproj 'MyProject'
 
pod 'ObjectiveSugar' , '~> 0.5'
 
target :test do
   pod 'OCMock' , '~> 2.0.1'
end
 
post_install do  |installer|
   installer.project.targets.each do  |target|
     puts "#{target.name}"
   end
end

  

ps:podfile中尤其要注意标点符号.

内容概要:本文提出了一种基于非合作博弈理论的居民负荷分层调度模型,并结合双层鲸鱼优化算法(Two-level Whale Optimization Algorithm)进行高效求解,模型与算法均通过Matlab代码实现。研究针对电力系统中居民侧用电负荷的复杂调度问题,引入非合作博弈机制刻画各用户之间的利益竞争关系,实现负荷的分层优化分配;同时设计双层优化架构,上层优化资源配置,下层模拟用户自主决策行为,提升了模型的实用性与合理性。通过智能优化算法求解多层级、非凸非线性的博弈模型,有效提高了调度方案的收敛性与全局寻优能力,适用于现代智能电网中的需求侧管理与能源优化场景。; 适合人群:具备电力系统基础理论知识和Matlab编程能力,从事智能电网、能源优化调度、需求侧管理、博弈论应用等方向的科研人员、高校研究生及工程技术人员。; 使用场景及目标:①应用于居民区电力负荷的分层优化调度系统设计与仿真分析;②为非合作博弈在多主体能源系统建模中的应用提供方法论支持;③利用双层鲸鱼算法解决具有嵌套结构的复杂双层优化问题,提升求解效率与调度方案的可行性。; 阅读建议:建议读者结合提供的Matlab代码深入理解模型构建逻辑与算法实现流程,重点关注博弈模型的效用函数设计、纳什均衡求解思路以及双层优化结构的迭代机制,宜配合实际用电数据开展复现实验以验证模型有效性与鲁棒性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值