小问题记录与解决

1. cocoa pods 升级遇到的问题

  • 运行
sudo gem update --system

报错

Updating rubygems-update
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/update_rubygems

原因:brew更新或重装的时候导致的我们电脑上没有ruby环境了,需要重新安装一下
解决方案:安装ruby

 brew install ruby

2. 执行 pod update 遇到问题

出现: Performing a deep fetch of themasterspecs repo to improve future performance

解决方案: 删除索引库,重新安装Pod,执行终端命令

rm -rf ~/.cocoapods/repos
pod setup

3.执行 pod setup 遇到的问题

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

  Cloning into 'master'...
  error: RPC failed; result=56, HTTP code = 200
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: index-pack failed

解决方案:

   cd 任意的一个使用Git的项目
   #执行
   git repack --max-pack-size=500m -a -d
   pod setup

4. 使用 sudo gem update --system 更新 gem 的时候出错

ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/update_rubygems

解决方案: 重新安装ruby

  1. 安装 Homebrew 一个Mac上用于管理命令行软件的工具
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. 安装ruby
    brew install ruby
  1. 更新 gem
  sudo gem update --system
  1. 安装pod
  sudo gem install -n /usr/local/bin cocoapods
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容