Cocoapods报错 Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine ...

使用Cocoapod初始化或搜索时报错 : Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.4.0
使用命令pod --version查看一下版本

Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.4.0
1.6.0

如果有新版本会在报错信息后标示这时你需要升级你的pod
升级方式一:

    1. 如果是用brew安装的直接终端输入 brew upgrade cocoapods回车等待即可。升级完成之后查看版本pod --version 我尝试后此方法不行
  • 2 卸载brew uninstall cocoapods重装brew install cocoapods不过尝试后还是报错
    升级方式二:终端输入gem install cocoapods --pre回车,这个方式不可行还是会报错ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why: Unable to download data from https://gems.ruby-china.org/ - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

解决

将已安装pod移除然后执行sudo gem install cocoapods
若苹果系统升级OS X EL Capitan后改为sudo gem install -n /usr/local/bin cocoapods
再次查看版本就正常了

你可能感兴趣的:(Cocoapods报错 Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine ...)