2018最新|2018最新 pod install 出错

之前因为安装nginx 把我的pod版本给覆盖了,导致pod版本出错。查阅了很多文章才找出来。
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `'from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /usr/local/Library/Homebrew/global.rb:3:in `'from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /usr/local/Library/brew.rb:16:in `'

:首先确认下Ruby的版本
MAC自带的Ruby版本一般比较低(记得是2.0.0,查看版本ruby -v),先升级一下,
1.没有安装homebrew的话先安装一下
ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.通过brew安装Ruby最新版本
brew update(最新的话直接跳过)
brew install ruby
三、重新安装一下cocoapods

【2018最新|2018最新 pod install 出错】不要使用sudo gem install cocoapods,这样的话可能会有一些问题 , 现在解决一下现在的问题 。
1. Uninstall Cocoapods:
sudogem uninstall cocoapods
2.Install cocoapods without sudo:
gem install cocoapods -V--no-ri --no-rdoc
3.Set up Cocoapods:
pod setup
大功告成!!!!!

    推荐阅读