CocoaPods常见问题

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

解决方案

  • 在这里下载ruby源码点击下载,并解压
  • 安装openssl
$ brew install openssl

如果提示

Warning: openssl 1.0.2l is already installed

说明已经安装了openssl

  • cd到解压好的ruby源码文件夹中
  • 配置源码(此处需要添加openssl目录索引)
$ ./configure --with-openssl-dir=/usr/local/ssl
  • 编译ruby源码
$ make
  • 最后安装ruby
$ 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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 159,458评论 4 363
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,454评论 1 294
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 109,171评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,062评论 0 207
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,440评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,661评论 1 219
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,906评论 2 313
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,609评论 0 200
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,379评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,600评论 2 246
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,085评论 1 261
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,409评论 2 254
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,072评论 3 237
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,088评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,860评论 0 195
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,704评论 2 276
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,608评论 2 270

推荐阅读更多精彩内容