`find_spec_for_exe': can't find gem cocoapods 解决方案

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'from /usr/local/bin/pod:23:in `

'from /usr/local/bin/ruby_executable_hooks:22:in `eval'from /usr/local/bin/ruby_executable_hooks:22:in `
'


执行下面命令即可:

sudo gem update --system && sudo gem install -n /usr/local/bin cocoapods


针对fastlane同样可以执行下面命令操作

一、更新rvm

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

sudo gem install rubygems-update

更新安装fastlane

sudo gem install fastlane

sudo gem install fastlane -NV

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

你可能感兴趣的:(`find_spec_for_exe': can't find gem cocoapods 解决方案)