Gem::GemNotFoundException)

pod install
提示:
/Library/Ruby/Site/2.0.0/rubygems.rb:270:in find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException) from /Library/Ruby/Site/2.0.0/rubygems.rb:298:inactivate_bin_path'
from /usr/local/bin/pod:22:in `

'

一.然后按照网上提示更新gem
sudo gem update --system
还是报错:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/update_rubygems
二.先安装rvm
看一下ruby版本 ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
然后安装
rvm install 2.3.0
提示成功
然后继续
sudo gem update --system
提示成功

然后
sudo gem install
提示
ERROR: While executing gem ... (Gem::CommandLineError)
Please specify at least one gem name (e.g. gem build GEMNAME)

三.看一下 ruby版本
ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
版本比较低,装一下2.3.0版本
rvm install 2.3.0
装成功了
然后 sudo gem update --system 提示成功

四.装一下pods
sudo gem install cocoapods
提示成功
然后
pod setup
提示错误
Setting up CocoaPods master repo
[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down

然后试试ping github.com 发现成功
在试一下gem update --system
然后在pod setup 成功了
pod --version
1.2.0

你可能感兴趣的