iOSCocoa Pods

CocoaPods 的安装流程

2017-07-12  本文已影响1人  andyJi
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
$ sudo gem update --system
$ pod search 第三方
$ vim Podfile

写入以下内容并保存 小提示:(终端vim文件 按 i 可编辑 ,esc 退出编辑,:wq 可保存退出)

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
inhibit_all_warnings!
use_frameworks!

target 'prj' do
    pod 'AFNetworking', '~>3.1'
end
$ pod install

以下是我用以前的安装流程安装时出现的一些错误

终端cocoapods下载bug调试:

错误1:

Error fetching http://ruby.taobao.org/:

bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)

解决方案:把安装流程中

$gem sources -a http://ruby.taobao.org/ 改为 $gem sources -a https://ruby.taobao.org/

错误2:

ERROR:  While executing gem ... (Errno::EPERM)

Operation not permitted - /usr/bin/pod

解决方案:苹果系统升级OS X EL Capitan后会出现的插件错误

sudo gem install cocoapods 改为 sudo gem install -n /usr/local/bin cocoapods

错误3:

[!] Unable to satisfy the following requirements: - `AVOSCloud (~> 3.1.6.3)` required by `Podfile`

Specs satisfying the `AVOSCloud (~> 3.1.6.3)` dependency were found, but they required a higher minimum deployment target.

解决方案:Podfile文件中platform:ios, '6.0'后边的 6.0 是平台版本号 ,一定要加上

上一篇 下一篇

猜你喜欢

热点阅读