美文网首页pod
安装Cocoapods

安装Cocoapods

作者: FlyingPenguin | 来源:发表于2016-07-02 09:44 被阅读39次

1 Cocoapods简介

https://cocoapods.org/

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It has over eighteen thousand libraries and can help you scale your projects elegantly.

2 安装Cocoapods

CocoaPods is built with Ruby and is installable with the default Ruby available on OS X.

2.1 替换Ruby源

ruby默认引用的Amazon S3的资源文件, 由于国内网络原因(你懂的), 所以将ruby源修改为淘宝的RubyGems 镜像.

$ gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/ $ gem sources -l

2.2 安装cocoapods

sudo gem install cocoapods
pod setup

成功后就可以用pod install安装cocoapods库.

3 遇到的问题及解决

  • Ruby版本太低
    //查看当前ruby版本
    $ ruby -v
    // 列出已知的ruby版本
    $ rvm list known
    // 安装ruby 2.2-head
    $ rvm install 2.2-head

  • gem版本太低
    sudo gem update

相关文章

网友评论

    本文标题:安装Cocoapods

    本文链接:https://www.haomeiwen.com/subject/rjrqjttx.html