CocoaPods 升级报错

内容

Traceback (most recent call last):
 4: from /Users/iosdev/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `
' 3: from /Users/iosdev/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval' 2: from /usr/local/bin/pod:23:in `
' 1: from /Users/iosdev/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems.rb:308:in `activate_bin_path' /Users/iosdev/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)

解决:

1、sudo gem update --system
2、gem install cocoapods

卸载老版本cocopods,执行下面命令,

可能会出现多个版本的cocoapods,可以选择一项一项的删除,也可以选择最后一项全部删除

sudo gem uninstall cocoapods

执行下面命令删除全局的缓存

sudo rm -fr ~/Library/Caches/CocoaPods/

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

gem list --local | grep cocoapods

然后使用命令逐个删除

$ sudo gem uninstall cocoapods-core

$ sudo gem uninstall cocoapods-deintegrate

安装CocoaPods, 这里默认你的brew和ruby已经安装好了

sudo gem install cocoapods

OS X 10.11以后系统的安装cocoapods 指令:

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

你可能感兴趣的:(CocoaPods 升级报错)