一,出错1:
按照网上的方法我进行安装发现报错瞬间懵逼,整了很久才解决
setup/Library/Ruby/Site/2.0.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)from
zhangzbdeMacBook-Pro:~ zhangzb$ pod setup/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 `'
解决方案:首先要删除原来装的东东删除配置
zhangzbdeMacBook-Pro:~ zhangzb$ which pod
/usr/local/bin/pod //这是安装的路径
zhangzbdeMacBook-Pro:~ zhangzb$ sudo rm -rf /usr/local/bin/pod //删除它
Password:
zhangzbdeMacBook-Pro:~ zhangzb$ gem list //看一下装的啥
*** LOCAL GEMS ***
activesupport (4.2.7.1)
bigdecimal (default: 1.2.0)
CFPropertyList (2.2.8)
claide (1.0.1)
cocoa (0.1.6)
cocoapods-core (1.1.1, 1.0.1) //我估摸着就是这里有问题
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.2)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.1.1)
cocoapods-try (1.1.0)
colored (1.2)
concurrent-ruby (1.0.2)
escape (0.0.4)
ffi (1.9.14)
fourflusher (2.0.1, 0.3.2)
fuzzy_match (2.0.4)
gh_inspector (1.0.2)
i18n (0.7.0)
io-console (default: 0.4.2)
json (default: 1.7.7)
libxml-ruby (2.6.0)
minitest (5.9.1, default: 4.3.2)
molinillo (0.5.2, 0.4.5)
nap (1.1.0)
netrc (0.7.8)
nokogiri (1.5.6)
pods (0.0.1)
psych (default: 2.0.0)
rake (default: 0.9.6)
rdoc (default: 4.0.0)
rubygems-update (2.6.7)
setup (5.2.0)
sqlite3 (1.3.7)
test-unit (default: 2.0.0.0)
thread_safe (0.3.5)
tzinfo (1.2.2)
xcodeproj (1.3.3)
删除
//删除之前下载的
$ sudo rm -fr ~/.cocoapods/repos/master
//继续删除
zhangzbdeMacBook-Pro:~ zhangzb$ sudo gem uninstall cocoapods-core -v 1.1.1
Successfully uninstalled cocoapods-core-1.1.1
zhangzbdeMacBook-Pro:~ zhangzb$ sudo gem uninstall cocoapods-core -v 1.0.1
Successfully uninstalled cocoapods-core-1.0.1
zhangzbdeMacBook-Pro:~ zhangzb$ sudo gem uninstall cocoapods -v 1.1.1
zhangzbdeMacBook-Pro:~ zhangzb$ sudo gem uninstall cocoapods -v 1.0.1
重装
删除完了,从新list看一遍没问题就可以从新下载了
zhangzbdeMacBook-Pro:~ zhangzb$ sudo gem install -n /usr/local/bin cocoapods
Fetching: cocoapods-core-1.1.1.gem (100%)
Successfully installed cocoapods-core-1.1.1
Successfully installed cocoapods-1.1.1
Parsing documentation for cocoapods-core-1.1.1
Installing ri documentation for cocoapods-core-1.1.1
Parsing documentation for cocoapods-1.1.1
Installing ri documentation for cocoapods-1.1.1
2 gems installed
zhangzbdeMacBook-Pro:~ zhangzb$ pod setup
Setting up CocoaPods master repo
二,查看安装情况
这里要是卡住不动多半是网络问题
cd ~/.cocoapods
zhangzbdeMacBook-Pro:.cocoapods zhangzb$ du -sh *
260K repos