cocoapods更新(安装)

一、准备工作

首先确认自己的ruby源是不是2.3.0以上的版本。
如果不是的话,请百度自行升级cocopods。

//命令行
ruby -v

//打印结果
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]

其次查看更换gem源

➜  ~ gem sources -l
*** CURRENT SOURCES ***

https://ruby.taobao.org/
➜  ~ gem sources --remove https://ruby.taobao.org/
https://ruby.taobao.org/ removed from sources
➜  ~ gem source -a https://gems.ruby-china.org
https://gems.ruby-china.org added to sources
➜  ~ gem sources -l
*** CURRENT SOURCES ***

https://gems.ruby-china.org

二、开始更新

sudo gem install -n /usr/local/bin cocoapods --pre

在这时会打印一大堆东西,打印完成后

➜  ~ pod --version
1.2.0.rc.1

接下来就是设置pod仓库了

➜  ~ pod setup
Setting up CocoaPods master repo
  $ /usr/bin/git -C /Users/bear/.cocoapods/repos/master fetch origin
  From https://github.com/CocoaPods/Specs
     75b5925..b6999c8  master     -> origin/master
   * [new branch]      predates_sharding_branch -> origin/predates_sharding_branch
   * [new tag]         v0.32.1    -> v0.32.1
  $ /usr/bin/git -C /Users/bear/.cocoapods/repos/master rev-parse --abbrev-ref
  HEAD
  master
  $ /usr/bin/git -C /Users/bear/.cocoapods/repos/master reset --hard
  origin/master
  Checking out files: 100% (249289/249289), done.
  HEAD is now at b6999c8 [Add] SuperLayout 0.2.3
warning: inexact rename detection was skipped due to too many files.
Setup completed

现在就可以愉快的使用新版本的cocopods了。

你可能感兴趣的:(cocoapods更新(安装))