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:in
activate_bin_path'
from /usr/local/bin/pod:22:in `<main>'
一.然后按照網(wǎng)上提示更新gem
sudo gem update --system
還是報(bào)錯(cuò):
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
提示成功
然后繼續(xù)
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
提示錯(cuò)誤
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 發(fā)現(xiàn)成功
在試一下gem update --system
然后在pod setup 成功了
pod --version
1.2.0