这种方式不是基于系统自带的Ruby
blog.argcv.com/articles/4429.c
最近pods的时候,会出现
/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 -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (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 /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:6:in `rescue in' from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.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 /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj.rb:30: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 /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods.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 /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:32:in `' from /usr/bin/pod:23:in `load' from /usr/bin/pod:23:in `'
这样类似的错误,感觉到应该ruby版本过低,既然pods有问题,就要系统解决下,而且还出现了pods版本过低(0.3.9)应该是 ,再一查pods居然到1.1.1了都, 索性花了一上午解决这个问题;
补充:淘宝的源,貌似已经不再为维护了,Ruby China担当起了这个责任,如果我们都像这些大神一样,中国科技势不可挡;链接我也贴出:
回到我们升级ruby ,因为这个是在安装pods前面的步骤;废话说也说了,下面我开始走流程(这篇是我升级完,才写的,有些图来自网上,各位贴图原作者不受意思啊)
$ruby -v // 查看当前版本
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
安装rvm,ruby vision manager
$curl -L get.rvm.io | bash -s stable
继续敲下面的两个命令
$source ~/.bashrc
$source ~/.bash_profile
$rvm list known // 查看所有的ruby版本,如果有明确想升级的版本,可不查看
$rvm install 2.3.0 // 开始安装
如果碰到
按回车,安装homebrew,等待安装,
按照提示,卸载, 然后重新安装
$ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
重写安装
版本不同,log信息可能稍有不同
如果你安装过了cocoa pods ,这时进行pod命令是不成功的,
需要移除 cocoa pods,重新安装
gem uninstall cocoapods
gem install cocoapods
pod setup
这样下来,基本可以用了,如果遇到问题可以留言