美文网首页iOS/Swift/ObjciOS 相关
cocapods 更新第三方库遇到的问题

cocapods 更新第三方库遇到的问题

作者: 垚子 | 来源:发表于2015-12-09 12:26 被阅读16572次

(1)卡在Updating local specs repositories

pod install  被墙了,请大家换成pod install --verbose --no-repo-update

(2)出现这种警告

Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.

解决办法:不要使用文本编辑去编辑Podfile,使用Xcode编辑,或者使用终端敲命令去编辑。或者输入格式错误,没输入运行版本:$platform:ios, ‘9.0‘

(3)使用cocoapods导入第三方类库后头文件没有代码提示?

解决办法: 选择Target -> Build Settings 菜单,找到\”User Header Search Paths\”设置项,新增一个值"${SRCROOT}",并且选择\”Recursive\”




安装要点

检查ruby的源

gem sources -l

注意:-l为list中的l,不是数字1

显示如下:

*** CURRENT SOURCES ***

https://rubygems.org/

或者为

https://ruby.taobao.org/

上面两个源目前都不能使用了。我的最开始安装失败的原因就是使用了淘宝的源。

移除旧源,添加新源

移除旧源

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

https://ruby.taobao.org/ removed from sources

添加新源

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

http://gems.ruby-china.org/ added to sources

检查下

$ gem sources -l

*** CURRENT SOURCES ***

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

显示已经添加成功

更新下gem版本

$ sudo gem update --system

如果是最新的版本会显示

Latest version currently installed. Aborting.

安装cocoapods

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

安装成功会显示:

Installing ri documentation for cocoapods-1.3.1

22 gems installed

验证

输入下面命令查看pod版本

$ pod --version

1.3.1

证明安装成功


著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

相关文章

网友评论

  • 52facef9cc1f:感谢,刚刚遇到这个问题。翻墙安装的。。。
  • 9648f522204f:大神,我想问下,我自己封装个afnetworking,报错,use of unresolved identifier 'AFHTTPSessionManager'
  • 楚简约:接手项目在Podfile中pod的第三方库,不包含所有Pods文件夹里面的第三方库,不能升级cocoapods. 现在需要一个最新的第三方框架,直接替换了pods里面的文件夹,出现头文件找不到情况,尝试用你的方法,但是还是没有解决
  • d56eed656c00:谢谢,帮我解决了问题。

本文标题:cocapods 更新第三方库遇到的问题

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