用CocoaPods和ReactiveCocoa的安装

关于用CocoaPods安装ReactiveCocoa的问题  ?

iOS 最新版 CocoaPods 的安装流程

1.移除现有Ruby默认源

$gem sources --remove https://rubygems.org/

2.使用新的源

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

3.验证新源是否替换成功

$gem sources -l

4.安装CocoaPods

(1)  $sudo gem install -n /usr/local/bin cocoapods

(2)  $pod setup

5.更新gem

$sudo gem update --system

6.  新建工程,并在终端用cd指令到文件夹内

$pod search ReactiveCocoa

7.新建文件 Podfile

$Podfile

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

platform :ios,'9.0'

pod 'ReactiveCocoa'

xcodeproj '/Users/zhoupengju/Downloads/ReactivePlayground-Starter/RWReactivePlayground'

use_frameworks!


8.安装文件


$pod install   或者  pod install --no-repo-update


看到 


Analyzing dependencies

Downloading dependencies

Installing ReactiveCocoa (4.0.1)

Installing Result (1.0.2)

Generating Pods project

Integrating client project


[!] Please close any current Xcode sessions and use `RWReactivePlayground.xcworkspace` for this project from now on. 


信息就说明OK了


9.安装文件


$pod update



 安装过程中碰到的问题汇总:

1. [!] Pods written in Swift can only be integrated as frameworks; this feature is still in beta. Add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pods being used are: Box, ReactiveCocoa, and Result
在Prodfile中添加   use_frameworks! 就OK了

2. 
  1. Could not automatically select an Xcode project. Specify one in your Podfile like so:
  2. xcodeproj 'path/to/Project.xcodeproj'
修改 xcodeproj '/Users/zhoupengju/Downloads/ReactivePlayground-Starter/RWReactivePlayground' 为当前工程Podfile的路径
或者 进入到当前xcode所在的目录进行install





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值