zoukankan      html  css  js  c++  java
  • cocoapods的安装

    1、升级Ruby环境

    终端输入:$ gem update --system

    此时若出现:ERROR:While executing gem......(Gem::FilePermissionError)

                         you don't have write permissions for  the /Library/Ruby/Gems/2.0.0 directory.

    这是因为你没有权限去升级Ruby

    此时输入:$ sudo gem update --system

    2、 更换 Ruby镜像

    (1)、  删除原先的源   

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

    (2)、添加新的源

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

    (3)、查看当前镜像

    终端输入:$gem sources -l

     如果结果是
    *** CURRENT SOURCES ***
    https://gems.ruby-china.com/
    说明添加成功,否则继续执行$ gem source -a https://gems.ruby-china.com/来添加
    3、安装CocoaPods
     终端输入:$ sudo gem install cocoapods
    如果出现下图1所示的错误:
    图1
     说明没有权限,需要输入
     终端输入:$ sudo gem install -n /usr/local/bin cocoapods
    安装成功如下图2所示:
    图2
    如果出现错误:
     ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
    ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
    ERROR:  While executing gem ... (Errno::EPERM)
        Operation not permitted - /usr/bin/pod
    macdeMBP:test-CocoaPods mac$ sudo gem install -n /usr/local/bin cocoapods
    ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
    ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
    出现这个问题,需要更新Ruby环境
    【1】安装Homebrew
    终端输入:$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    【2】安装rvm
    终端输入:$ curl -L get.rvm.io | bash -s stable
    【3】装载rvm
    终端输入:$ source ~/.rvm/scripts/rvm
    【4】重新安装cocoapods
    4、终端输入:$pod setup
    若出现以下错误请参照该图所示:
                                                     
  • 相关阅读:
    循环结构
    位运算符
    Switch 选择结构
    if结构和逻辑运算符
    变量和运算符
    [luogu1090 SCOI2003] 字符串折叠(区间DP+hash)
    [luogu2329 SCOI2005] 栅栏(二分+搜索)
    [luogu 4886] 快递员
    [luogu4290 HAOI2008]玩具取名(DP)
    [luogu2624 HNOI2008]明明的烦恼 (prufer+高精)
  • 原文地址:https://www.cnblogs.com/sdx-highlight/p/11370073.html
Copyright © 2011-2022 走看看