CocoaPods常见问题

2017-06-12  本文已影响114人  TIGER_XXXX

[!] The version of CocoaPods used to generate the lockfile (1.2.0) is higher than the version of the current executable (1.0.0). Incompatibility issues may arise.

$ pod install
Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (1.2.0) is higher than the version of the current executable (1.0.0). Incompatibility issues may arise.

解决方案

$ sudo gem install cocoapods

Updating installed gems Nothing to update

$ gem update cocoapod
Updating installed gems
Nothing to update

待解决


替换ruby源

$ gem sources
*** CURRENT SOURCES ***

http://rubygems-china.oss.aliyuncs.com

这个数据源已经失效了,我们移除掉

$ gem sources -r http://rubygems-china.oss.aliyuncs.com
http://rubygems-china.oss.aliyuncs.com removed from sources

加入新的数据源,目前只有ruby-china的源是保持更新的

$ gem sources -a https://gems.ruby-china.org/
https://gems.ruby-china.org/ added to sources

确保当前只有一个ruby源

$ gem sources
*** CURRENT SOURCES ***

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

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

$ 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

解决方案

$ brew install openssl

如果提示

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时显示以下报错

解决方法
更新一下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报错


解决方法

  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

上一篇下一篇

猜你喜欢

热点阅读