CocoaPods的一波三则
CocoaPods是IOS中一个类似Java种的ant和maven的一个工具,说白了就是帮助用户管理外部依赖库。
但是这东西安装起来却是那么的蛋疼。
在mac中使用 ruby -v 和 gem -v 查看版本号码,如果版本低于2.0.0,一定要更新到此版本,不然后面将会出现权限不够错误
我在此错误上,每次都使用sudo去执行,安装成功,就是会出现一些意想不到的 Permission denied不足错误。
更新ruby最好是采用rvm工具,也不要切换到淘宝的gem更新中去,淘宝的库里面没有IOS的东西。
申请一个免费的vpn更新gem,因为每次出错都是这里,更新的东西很少,最多几分钟。
执行这两条命令是不需要 sudo的,如果采用sudo的话,肯定是的ruby 没有更新到2.0.0去。
gem install cocoapods
pod setup
如果上面因为权限问题安装失败,必须每次都要删除
rm -rf /Users/loginnanme/Library/Caches/CocoaPods/
因为这个缓存中会存下你的github的东西,造成每次都调用上次权限问题的缓存。
反正CocoaPods是让我折腾了一周。终于搞定了。
$:ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
$:gem -v
2.0.5
$:gem install cocoapods
Fetching: rake-10.0.4.gem (100%)
Successfully installed rake-10.0.4
Fetching: cocoapods-core-0.19.1.gem (100%)
Successfully installed cocoapods-core-0.19.1
Fetching: claide-0.2.0.gem (100%)
Successfully installed claide-0.2.0
Fetching: cocoapods-downloader-0.1.0.gem (100%)
Successfully installed cocoapods-downloader-0.1.0
Fetching: xcodeproj-0.5.5.gem (100%)
Building native extensions. This could take a while...
Successfully installed xcodeproj-0.5.5
Fetching: multipart-post-1.2.0.gem (100%)
Successfully installed multipart-post-1.2.0
Fetching: faraday-0.8.7.gem (100%)
Successfully installed faraday-0.8.7
Fetching: addressable-2.3.4.gem (100%)
Successfully installed addressable-2.3.4
Fetching: faraday_middleware-0.9.0.gem (100%)
Successfully installed faraday_middleware-0.9.0
Fetching: hashie-2.0.5.gem (100%)
Successfully installed hashie-2.0.5
Fetching: netrc-0.7.7.gem (100%)
Successfully installed netrc-0.7.7
Fetching: octokit-1.24.0.gem (100%)
Successfully installed octokit-1.24.0
Fetching: json-1.7.7.gem (100%)
Building native extensions. This could take a while...
Successfully installed json-1.7.7
Fetching: cocoapods-0.19.1.gem (100%)
Successfully installed cocoapods-0.19.1
Parsing documentation for rake-10.0.4
Installing ri documentation for rake-10.0.4
Parsing documentation for cocoapods-core-0.19.1
Installing ri documentation for cocoapods-core-0.19.1
Parsing documentation for claide-0.2.0
Installing ri documentation for claide-0.2.0
Parsing documentation for cocoapods-downloader-0.1.0
Installing ri documentation for cocoapods-downloader-0.1.0
Parsing documentation for xcodeproj-0.5.5
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for ext/xcodeproj/xcodeproj_ext.bundle, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for ext/xcodeproj/xcodeproj_ext.o, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for ext/xcodeproj_ext.bundle, skipping
Installing ri documentation for xcodeproj-0.5.5
Parsing documentation for multipart-post-1.2.0
Installing ri documentation for multipart-post-1.2.0
Parsing documentation for faraday-0.8.7
Installing ri documentation for faraday-0.8.7
Parsing documentation for addressable-2.3.4
Installing ri documentation for addressable-2.3.4
Parsing documentation for faraday_middleware-0.9.0
Installing ri documentation for faraday_middleware-0.9.0
Parsing documentation for hashie-2.0.5
Installing ri documentation for hashie-2.0.5
Parsing documentation for netrc-0.7.7
Installing ri documentation for netrc-0.7.7
Parsing documentation for octokit-1.24.0
Installing ri documentation for octokit-1.24.0
Parsing documentation for json-1.7.7
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/json/ext/generator.bundle, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/json/ext/parser.bundle, skipping
Installing ri documentation for json-1.7.7
Parsing documentation for cocoapods-0.19.1
Installing ri documentation for cocoapods-0.19.1
14 gems installed
$:pod setup
Setting up CocoaPods master repo
Already up-to-date.
CocoaPods 0.22.2 is available.
Setup completed (read-only access)
$ cd /Users/testname/Desktop/TestCocoaPods
$ ls
TestCocoaPods TestCocoaPods.xcodeproj TestCocoaPodsTests
$ vim Podfile
platform :ios, '5.0'
pod 'JSONKit', '~> 1.4'
pod 'Reachability', '~> 3.0.0'
pod 'UI7Kit', '~>0.3.2'
pod 'RegexKitLite'
$ pod install
Analyzing dependencies
CocoaPods 0.22.2 is available.
Downloading dependencies
Installing FoundationExtension (0.37.1)
Installing JSONKit (1.5pre)
Installing KLSwitch (1.5)
Installing Reachability (3.0.0)
Installing RegexKitLite (4.0)
Installing UI7Kit (0.3.2)
Installing cdebug (0.1.1)
Generating Pods project
Integrating client project
[!] From now on use `TestCocoaPods.xcworkspace`.
完整的架构项目流程

浙公网安备 33010602011771号