CocoaPods搭建私有库遇到问题

作者: __Mr_Xie__ | 来源:发表于2018-12-26 10:09 被阅读10次

前言

CocoaPods搭建私有库过程中,有人碰到问题,根据反馈,我就不一一回复了,写篇文章统一回复。

反馈的问题

使用 pod lib create XXX 命令会出现下面这个问题:

```/Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project/object/helpers/build_settings_array_settings_by_object_version.rb:27:in <module:BuildSettingsArraySettingsByObjectVersion>': undefined methodto_set' for #<Array:0x007fbe0d0960c8> (NoMethodError)
Did you mean? to_s
from /Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project/object/helpers/build_settings_array_settings_by_object_version.rb:8:in <class:XCBuildConfiguration>' from /Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project/object/helpers/build_settings_array_settings_by_object_version.rb:4:in<module:Object>'
from /Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project/object/helpers/build_settings_array_settings_by_object_version.rb:3:in <class:Project>' from /Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project/object/helpers/build_settings_array_settings_by_object_version.rb:2:in<module:Xcodeproj>'
from /Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project/object/helpers/build_settings_array_settings_by_object_version.rb:1:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project/object/build_configuration.rb:194:in<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project/object.rb:521:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project.rb:5:in<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /Users/liuchuan/LAXCategoryKit/setup/ProjectManipulator.rb:30:in run' from /Users/liuchuan/LAXCategoryKit/setup/ConfigureiOS.rb:73:inperform'
from /Users/liuchuan/LAXCategoryKit/setup/ConfigureiOS.rb:7:in perform' from /Users/liuchuan/LAXCategoryKit/setup/TemplateConfigurator.rb:85:inrun'
from ./configure:9:in `<main>'

To learn more about the template see https://github.com/CocoaPods/pod-template.git.
To learn more about creating a new pod, see http://guides.cocoapods.org/making/making-a-cocoapod.```

解决方案步骤:

1、在~/.cocoapods/repos目录,把Xcodeproj clone到该目录下;

image

2、在~/.cocoapods/repos/Xcodeproj目录,执行终端命令:

gem build xcodeproj.gemspec

3、在~/.cocoapods/repos/Xcodeproj目录,执行终端命令:

sudo gem install ./xcodeproj-1.7.0.gem

注:在执行终端命令:sudo gem install ./xcodeproj-1.7.0.gem过程中,如果ruby版本过低,会出现问题:/usr/bin Operation not permitted。解决办法:将ruby升级到最新版本,重新安装CocoaPods。

image
                        (长按图片,识别图中的微信二维码)

                        也可以关注我的新浪微博“__Mr_Xie__”

相关文章

  • CocoaPods私有库搭建说明

    CocoaPods私有库搭建说明 关于CocoaPods CocoaPods是Swift和Objective-C ...

  • CocoaPods搭建私有库遇到问题

    前言 CocoaPods搭建私有库过程中,有人碰到问题,根据反馈,我就不一一回复了,写篇文章统一回复。 反馈的问题...

  • CocoaPods开源库的搭建

    前言 如果你看了我之前写的文章《CocoaPods私有库的搭建》,而且有过实战,你会发现《CocoaPods开源库...

  • CocoaPods使用总结

    CocoaPods 公共库的创建CocoaPods 本地私有库的创建(模板创建方式)CocoaPods 本地私有库...

  • Pod搭建开源库小结

    1./Users/xxx/.cocoapods/repos 不管是搭建私有库还是开源库,这个路径下版本库repos...

  • Cocoapods私有库搭建

    最近在整理组件化相关的东西,其中有一项就是用pod管理内部的一些公共组件,为了加深印象,下面把具体步骤记录一下(注...

  • cocoapods 私有库搭建

    直入正题,原理性的东西边写边讲吧~。 首先我们需要用到两个私有git仓库,一个用于存放我们私有代码库,一个用于存p...

  • 搭建CocoaPods私有库

    因为公司的需要重新搞了一次CocoaPods,于是记录一下这次折腾下来的整个过程。 准备 开始之前,先说一下开发环...

  • CocoaPods私有库搭建

    CocoaPods 安装入门就不多说了可以看这个 https://www.jianshu.com/p/ab6411...

  • CocoaPods 私有库搭建

    本文源自本人的学习记录整理与理解,其中参考阅读了部分优秀的博客和书籍,尽量以通俗简单的语句转述。引用到的地方如有遗...

网友评论

    本文标题:CocoaPods搭建私有库遇到问题

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