今天新苹果机安装cocoapods,安装完以后发现怎么pod search 都没有用

命令行提示:

swhcxp@iosdevmac ~ % pod search Almofire                            

Setup completed

[!] Unable to find a pod with name, author, summary, or description matching `Almofire`

 

然后我重装homebrew , RVM, Ruby,Cocoapods,都安装到最新还是没用

Homebrew官网安装

命令行输入

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

如果raw.githubsercontent.com访问不了,在/private/etc/Hosts文件中添加:199.232.4.133 raw.githubusercontent.com

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
0.0.0.0 account.jetbrains.com
199.232.4.133 raw.githubusercontent.com

或者使用国内镜像安装

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" 

如果失败多试几次,可能是你的网络问题,安装完成以后命令行输入:brew -v ,查看homebrew版本看看是否安装成功。

RVM安装

1.命令行输入命令:

$ curl -L https://get.rvm.io | bash -s stable

2.载入RVM环境

$source ~/.rvm/scripts/rvm

3.查看安装结果版本

$ rvm -v

  

使用RVM环境安装Ruby

1.列出已知版本

$ rvm list known

2.安装指定ruby版本

$ rvm install 2.3.0

3.查看ruby安装状态和版本

$ ruby -v

彻底卸载旧Cocoapods

卸载老版本cocopods

$ sudo gem uninstall cocoapods

  

2.查看本地安装过的cocopods相关东西

$ gem list --local | grep cocoapods

显示如下:

cocoapods (1.0.1)

cocoapods-core (1.0.1)

cocoapods-deintegrate (1.0.1)

cocoapods-downloader (1.1.1)

cocoapods-plugins (1.0.0)

cocoapods-search (1.0.0)

cocoapods-stats (1.0.0)

cocoapods-trunk (1.0.0)

cocoapods-try (1.1.0)

然后使用命令逐个删除

$ sudo gem uninstall cocoapods-core

$ sudo gem uninstall cocoapods-deintegrate

  

Cocoapods安装

升级gem

sudo gem update --system

更换镜像源

$ gem sources --remove  https://rubygems.org/
$ gem sources -a https://gems.ruby-china.com
$ gem sources -l

安装

OS X 10.11之前系统的安装cocoapods 指令:

$ sudo gem install cocoapods

OS X 10.11以后系统的安装cocoapods 指令,可安装制定版本:

$ sudo gem install -n /usr/local/bin cocoapods
$ sudo gem install -n /usr/local/bin cocoapods -v 1.9.2

提示安装完成后,查看一下pod版本

pod --version

  

尝试删除~/Library/Caches/CocoaPods/search_index.json重新pod search还是不起作用

最后解决方案:

来源:https://www.cnblogs.com/huaida/p/12701080.html

pod repo remove master

cd ~/.cocoapods/repos

git clone --depth 1 https://github.com/CocoaPods/Specs.git master

rm ~/Library/Caches/CocoaPods/search_index.json

pod search afnetworking

  

问题汇总:

[!] CDN: trunk - Cannot perform full-text search because Algolia returned an error: 0: Cannot reach any host: execution expired, execution expired, 
SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate), execution expired  

解决方式:保证Podfile文件头:source ‘https://github.com/CocoaPods/Specs.git‘, 然后执行:pod repo remove trunk , 再重新pod seach XXX,就可以了!

解决删除~/Library/Caches/CocoaPods/search_index.json重新pod search还是不起作用的更多相关文章

  1. CocoaPods中pod search报错的解决办法

    pod search报错的原因: 每次使用pod search命令的使用会在该目录下生成一个search_index.json文件,会逐渐的增大,文件达到一定大小后,ruby解析里面的json字符就会 ...

  2. 删除安装的 cocoapods 的缓存方法

    清除 Cocoapods 本地缓存 特殊情况下,由于网络或者别的原因,通过 cocoapods 下载的文件可能会有问题.这时候可以删除 Cocoapods 的缓存(~/Library/Caches/C ...

  3. 报错:/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.29.5/UITableView.m:7943解决方法

    环境:Xcode7.1.1 详细错误: *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], ...

  4. System path '/Users/hxy/Library/Caches/PyCharm2018.2' is invalid.

    Mac系统下安装pycharm后启动出现System path '/Users/hxy/Library/Caches/PyCharm2018.2' is invalid.问题: 1.出现原因: 1.1 ...

  5. iOS Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.30.14/UITableView.m:7962

      Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Cac ...

  6. 解决删除域用户Exception from HRESULT: 0x80072030

    解决删除域用户异常问题. System.DirectoryServices.DirectoryServicesCOMException was unhandled  Message=在服务器上没有这样 ...

  7. 在xocde运行profile 遇到"Existing default base temp directory '/Library/Caches/com.apple.dt.instruments' has insufficient privileges for user id 505. Please have the owner delete this directory"

    找到这篇文章 http://stackoverflow.com/questions/34153795/xcode-7-unable-to-open-instruments-from-developer ...

  8. 解决删除/升级Python导致Ubuuntu无法进入桌面的问题

    找到问题的原因后于是换个思路,想大概修复了python,Ubuntu进入桌面应该也就没啥问题了.于是重新安装Python发现还是无济于事.也通过/usr/bin/python: can't find ...

  9. 使用CocoaPods卡在了"pod setup"界面的解决办法

      http://blog.csdn.net/samoy/article/details/51956799   有时候,我们在执行pod install或pod search命令时,会在终端偶现卡在’ ...

随机推荐

  1. 理解分布式一致性:Paxos协议之Basic Paxos

    理解分布式一致性:Paxos协议之Basic Paxos 角色 Proposal Number & Agreed Value Basic Paxos Basic Paxos without f ...

  2. 【Linux常见命令】vimdiff命令

    在类nuix平台,我们希望对文件之间的差异之间快速定位,希望能够很容易的进行文件合并……. 可以使用Vim提供的diff模式,通常称作vimdiff,就是这样一个能满足所有这些需求,甚至能够提供更多的 ...

  3. 【STM32 .Net MF开发板学习-05】PC通过Modbus协议远程操控开发板

    从2002年就开始接触Modbus协议,以后陆续在PLC.DOS.Windows..Net Micro Framework等系统中使用了该协议,在我以前写的一篇博文中详细记载了这一段经历,有兴趣的朋友 ...

  4. pomelo安装笔记

    npm install -dnpm config set registry https://registry.npm.taobao.orgnpm install pomelo -gpomelo lis ...

  5. CF思维联系– Codeforces-990C Bracket Sequences Concatenation Problem(括号匹配+模拟)

    ACM思维题训练集合 A bracket sequence is a string containing only characters "(" and ")" ...

  6. unittest(生成测试报告)

    1.先导入HTMLTestRunner模块 见上篇HTMLTestRunner模块生成文档 2.实例如下 (1)单用例文件执行且生成报告 import unittest import HTMLTest ...

  7. Android控件重叠显示小记

    方案一 利用布局控件显示优先级 在xml中RelativeLayout,FrameLayout,靠后的控件显示在上层. 利用margin属性 margin属性可以控制控件间的距离,属性值为正值时,越大 ...

  8. 线段树 逆序对 Minimum Inversion Number HDU - 1394 Laptop

    Minimum Inversion Number HDU - 1394 求最小反转数,就是求最少的逆序对. 逆序对怎么求,就是先把所有的数都初始化为0,然后按照顺序放入数字,放入数字前查询从这个数往后 ...

  9. spring中bean的常用属性

    一.scop scope用来配置bean对象是否是单例模式.单例模式是java的二十三种设置模式之一,指在这个项目运行过程中一 个类的对象只会实例化一次.一般,工厂类的对象都是单例模式.非单例模式叫多 ...

  10. 王颖奇 20171010129《面向对象程序设计(java)》第十周学习总结

    实验十  泛型程序设计技术 实验时间 2018-11-1 1.实验目的与要求 (1) 理解泛型概念: (2) 掌握泛型类的定义与使用: (3) 掌握泛型方法的声明与使用: (4) 掌握泛型接口的定义与 ...