pod更新遇到的问题

2020-12-27  本文已影响0人  super_2e20
1、Mac升级macOS Big Sur后 homebrew失效
 homebrew-core is a shallow clone.
 To `brew update`, first run:
 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
 This restriction has been made on GitHub's request because updating shallow
 clones is an extremely expensive operation due to the tree layout and traffic of
 Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
 automatically to avoid repeatedly performing an expensive unshallow operation in
 CI systems (which should instead be fixed to not use shallow clones). Sorry for
 the inconvenience!

升级macOS Big Sur后homebrew失效了,解决办法brew update-reset

 brew update-reset
2、CocoaPods安装/更新报错While executing gem ... (OpenSSL::SSL::SSLError)解决方案

原因是gem没有认证gems.ruby-china.org的证书,所以添加一下这个源就可以了。

$ gem sources -a http://gems.ruby-china.org/

检测一下结果:

 MacBook-Pro:~ Heinoc$ gem sources -l
 *** CURRENT SOURCES ***

 https://ruby.taobao.org/
 http://gems.ruby-china.org/

然后再去更新gem版本即可:

 $ sudo gem update --system

附上CocoaPods的安装、更新方法:
1.更新gem系统:

  $ sudo gem update --system

2.查看gem源:

   $ gem sources -l

注:如果源中有https://rubygems.org/ ,因容易被墙,建议删除,并添加国内淘宝源:

$ gem sources --remove https://rubygems.org/ 
$ gem sources -a https://ruby.taobao.org/ 

3.安装CocoaPods:

$ sudo gem install cocoapods

如果报错While executing gem ... (OpenSSL::SSL::SSLError),则执行:

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

4.设置pod仓库:

$ pod setup

如果还是没有解决

  $ gem update --system
  Updating rubygems-update
   ERROR:  While executing gem ... (OpenSSL::SSL::SSLError)
    hostname "upyun.gems.ruby-china.org" does not match the server certificate

解决方案

如果提示

Warning: openssl 1.0.2l is already installed

说明已经安装了openssl

$ ./configure --with-openssl-dir=/usr/local/ssl

$ make

$ sudo make install


ERROR: While executing gem ... (Errno::EACCES) Permission denied - /Library/Ruby/Gems/2.0.0/gems/rubygems-update-2.6.7/.autotest

$ gem update --system
Updating rubygems-update
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - /Library/Ruby/Gems/2.0.0/gems/rubygems-update-2.6.7/.autotest

解决方案

$ sudo gem update --system


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

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

解决方案
安装homebrew homebrew官网
然后安装ruby

$ brew install ruby


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

$ sudo gem install cocoapods
Password:
etching: colored2-3.1.2.gem (100%)
Successfully installed colored2-3.1.2
Fetching: claide-1.0.2.gem (100%)
Successfully installed claide-1.0.2
Fetching: xcodeproj-1.5.0.gem (100%)
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/xcodeproj

解决方案

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


error: RPC failed; curl 56 SSLRead() return error -36

[!] /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

注意

  1. "/Applications/Xcode.app/Contents/Developer"此路径是当前默认XCode的所在位置,如果安装了多个XCode需要多加注意
  2. 做了以上操作之后还会报错,将XCode删除,重新安装

PS
获取当前XCode路径,在终端中输入

$ xcode-select --print-path


error: RPC failed; curl 56 SSLRead() return error -9806

解决方案

$ git config --global http.postBuffer 524288000
$ pod setup


Unable to find a specification for "xxxx"

问题描述:
pod install时显示以下报错

image

解决方法
更新一下repo,然后再install
更新repo的命令如下

pod repo update


[!] <PBXSourcesBuildPhase UUID=7DA7EFEB1FDA23A800B17618> attempted to initialize an object with an unknown UUID. 6124B2561FECCEB200077BCA for attribute: files. This can be the result of a merge and the unknown UUID is being discarded.

问题描述
同事pod新库之后合并代码,我这边拉下来之后重新pod install报错

image

解决方法

  1. 选中 项目名称–>Target–>项目名称–>General–>Linked Frameworks and Libraries–>选中 libpods-项目名称.a 去除掉这个 .a
  2. 然后再一次 pod install
  3. 如果出现pod下面没有文件,就把Xcode关掉重新打开就好了

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

解决方案:https://www.jianshu.com/p/a502eb72b689

引用
https://blog.csdn.net/myiphon/article/details/110918806
https://www.jianshu.com/p/4c3898383b62
https://www.cnblogs.com/heinoc/p/7723355.html
https://www.cnblogs.com/heinoc/p/7723355.html

上一篇下一篇

猜你喜欢

热点阅读