CocoaPods安装

1、升级Ruby环境

        终端输入:$ gem update --system

2、更换Ruby镜像

        首先移除现有的Ruby镜像

                终端输入:$ gem sources --remove https://rubygems.org/

        然后添加国内最新镜像源

                终端输入:$ gem sources -a https://gems.ruby-china.com/

        执行完毕之后输入gem sources -l来查看当前镜像

                终端输入:$ gem sources -l

3、安装CocoaPods

        接下来开始安装

                终端输入:$ sudo gem install cocoapods

        如果提示没有权限

                终端输入:$ sudo gem install -n /usr/local/bin cocoapods

        安装成功,到这之后再执行pod setup

                终端输入:$ pod setup

你可能感兴趣的:(CocoaPods安装)