美文网首页
安装 CocoaPods

安装 CocoaPods

作者: wilken | 来源:发表于2018-10-10 14:57 被阅读0次

    1.gem sources -l 查看当前 gem 的源

    2.删除原来的 gem 源 添加中国环境的源

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

    gem sources -a http://gems.ruby-china.com/

    3.安装 cocoapos

    sudo gem install cocoapods

    如果出现错误:ERROR: While executing gem ... (Errno::EPERM)

        Operation not permitted - /usr/bin/xcodeproj

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

    4.cd 到项目根目录

    执行 pod init 生成podfile 文件

    5.编辑 podfile 文件添加第三方库

    ->搜索第三方库 执行 pod search '第三方库名称'

    ->把第三方库添加到 podfile

     pod '第三方库名称'

    6:安装第三方库

    pod intall

    7:打开项目

    项目名字.xcworkspace

    本文章来源:https://blog.csdn.net/qq_18505715/article/details/78833328

    相关文章

      网友评论

          本文标题:安装 CocoaPods

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