iOS组件化开发一本地环境配置(一)

首先我们要使用pod支持组件化开发

  • 解决CocoaPods慢的方案(gem和pod repo换源)
  • gem换源 
    $ gem sources --remove https://rubygems.org/ # 移除默认源 
    $ gem sources -a https://gems.ruby-china.org/ # 添加Ruby China镜像 
    $ gem sources -l 

    确保只有gems.ruby-china.org源


    pod repo换源 
    $ pod repo 

    默认是GitHub源


    master 
    - Type: git (master) 
    - URL: https://github.com/CocoaPods/Specs.git 
    - Path: /Users/cheng/.cocoapods/repos/master 
    1 repo 

    我们把它换成Coding.net源

  • $ pod repo remove master 
    $ pod repo add master https://git.coding.net/CocoaPods/Specs.git 
    $ pod repo update 

    如果执行pod repo add出现错误

  • 错误 


    那么使用以下办法


    $ git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master 
    $ pod repo update 

    另外,如果Podfile文件中有


    source 'https://github.com/CocoaPods/Specs.git' 

    也需要把它换成repo的源,否则依然是使用GitHub源
    上面的步骤都完成后,即可使用


    $ pod install 
    $ pod update 

pod search AFNetworking

出现错误:

1、what did you do ?

2、Unable to find a pod with name, author, summary, or descriptionmatching

等错误

删除~/Library/Caches/CocoaPods目录下的search_index.json文件

pod setup成功后,依然不能pod search,是因为之前你执行pod search生成了search_index.json,此时需要删掉。

终端输入:rm ~/Library/Caches/CocoaPods/search_index.json

删除成功后,再执行pod search。

pod search MobileKit

 

[!] An unexpected version directory `Classes` was encountered for the `/Users/zhangpeng/.cocoapods/repos/gitee-peter_zhang-mobilekit/MobileKit` Pod in the `MobileKit` repository.

$ cd /Users/zhangpeng/.cocoapods/repos/

$ ls

master   gitee-peter_zhang-mobilekit.   MobileKitSpec

删除多余的

 

 

 

 

转载于:https://www.cnblogs.com/PeterWolf/p/9304335.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值