美文网首页
cocoapods ERROR: Error installin

cocoapods ERROR: Error installin

作者: 杏子_2fd0 | 来源:发表于2023-03-13 17:39 被阅读0次

    最近pod install 的时候总是报错,试了几次还是报

    :cocoapods ERROR: Error installing cocoapods:

        ERROR: Failed to build gem native extension.

    一气之下重新安装pod,成功解决报错,下面为安装不步骤,记录一下

    1、安装Homebrew

    /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

    2、通过brew安装ruby

    (1)命令:brew install ruby

    (2)配置环境变量:

    echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

    source ~/.bash_profile

    3、安装 CocoaPods

    (1)sudo gem install -n /usr/local/bin cocoapods

    (2)pod repo update --verbose

    4、替换镜像源

    (1)移除:sudo gem sources--removehttps://rubygems.org/

    (2)添加:sudo gem sources--addhttps://gems.ruby-china.com

    (3)查看:gem sources -l

    相关文章

      网友评论

          本文标题:cocoapods ERROR: Error installin

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