美文网首页
cocoaPod 安装和错误处理

cocoaPod 安装和错误处理

作者: 小码儿 | 来源:发表于2020-08-20 15:03 被阅读0次
cocoaPod 安装 Xcode->homebrew->RVM->Ruby->CocoaPods;
一:安装RVM
1.安装homeBrew:http://brew.sh/index_zh-cn.html
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.curl -L https://get.rvm.io | bash -s stable 等几分钟后
3.source ~/.rvm/scripts/rvm   载入 RVM 环境
4.rvm -v  检查一下是否安装正确

二:安装ruby
1. rvm list known (列出已知的ruby版本)
2.rvm requirements (rvm 需要那些包)
3. rvm install 2.3.3
4. rvm 2.3.3 --default
5. ruby -v (查看版本)

三:Gem 换ruby-china
1.gem sources -l
2. gem sources --remove XXX
3. gem sources -a https://gems.ruby-china.org

四:安装cocoapods
1. gem -v (查看版本)
2. sudo gem update --system 
3. sudo gem install -n /usr/local/bin cocoapods
4.配置git config:git config --global http.postBuffer 536870912  (500M)
5. git clone https://coding.net/u/hging/p/Specs/git ~/.cocoapods/repos/master  (经历过多次报错直接用改方法, `https://coding.net/u/hging/p/Specs/git`已经不更新了所以试下`https://github.com/CocoaPods/Specs.git`)
6.pod setup (或者执行$ pod repo update $ pod repo)

五:常见的报错
报错1
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master

Cloning into 'master'...
error: RPC failed; curl 56 SSLRead() return error -36
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
解决:sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

报错2
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master

Cloning into 'master'...
error: RPC failed; curl 56 SSLRead() return error -9806
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
报错3
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master

Cloning into 'master'...
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

解决:报错2和报错3 到现在没有找到特别好的方法,只能 走git clone https://coding.net/u/hging/p/Specs/git ~/.cocoapods/repos/master 然后再pod setup


报错4: rvm install 2.3.0 :
Error: /usr/local/opt/readline is not a valid keg

Requirements installation failed with status: 1.

 解决:rvm autolibs read-only # read more here:https://rvm.io/rvm/autolibs

rvm install ruby


报错5: Error running '__rvm_make -j 1',

please read /Users/ikuan/.rvm/log/1504160588_ruby-2.4.1/make.log

There has been an error while running make. Halting the installation.

解决:存在多个xcode, xcode-select —install ,后面会弹出一个页面点击安装。



报错6. sudo gem update —system

ERROR:  Loading command: update (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
解决:brew install homebrew/dupes/zlib

关于1.2.11,我们可以进入/usr/local/Cellar/zlib文件夹后可以查看到
rvm reinstall 2.3.3 --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11

报错7.
[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down


sudo rm -fr ~/.cocoapods/repos/master
git clone https://coding.net/u/hging/p/Specs/git ~/.cocoapods/repos/master
pod setup(或者执行$ pod repo update $ pod repo)

相关文章

  • cocoaPod 安装和错误处理

  • 工具:cocoaPads使用

    cocoaPod的安装参考资料cocoaPod安装 常见问题: 1、已经安装过cocoaPod,执行pod相关命令...

  • iOS工程的cocoapod道路

    目录一、前言二、安装Cocoapod  1、ruby环境  2、安装Cocoapod三、使用Cocoapod  1...

  • ios cocoapod安装

    这次安装只是对已有项目进行安装。默认已经安装cocoapod,如果没有安装cocoapod自行搜索。 1.打开终端...

  • 2019-02-20: Cocoapod安装?

    一:Cocoapod安装前准备环境? <—— 安装cocoapod:需要macOS自带的ruby环境<—— rub...

  • 结合CocoaPod本地开发Framework实践(2019-1

    CocoaPod安装 安装命令,要求输入的密码是Mac的开机密码sudo gem install cocoapod...

  • 下载和安装Cocoapod:

    系统升级到Mac 10.11后发现pod命令不能使用了,并且出现:于是执行install指令来更新下,结果提示ER...

  • Cocoapod安装和使用

    大家可曾遇到在github上下载人家的demo,结果运行出现错误?其实多数原因是因为人家是用cocoapod管理工...

  • CocoaPod安装和使用

    我们经常会使用到CocoaPod,但是最近我安装的时候碰到了好多的问题,也查了好多的文章,现在就总结一下我遇到的问...

  • cocoapod 异常记录

    换了新Mac 重新安装cocoapod 记录安装过程和问题 安装好 xcode、Homebrew、RVM、Ruby...

网友评论

      本文标题:cocoaPod 安装和错误处理

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