Mac下安装过octopress导致ruby版本不对,cocoapods无法使用的解决方法
由于之前弄过octopress,最近要用cocoapods发现无法使用:
boxertandeiMac:~ boxertan$ pod
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'cocoapods' (>= 0) among 35 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/bin/pod:22:in `<main>’
因为cocoapods需要用到比较新的ruby版本,而octopress要用1.9.3,所以,我们用rvm安装2个版本,然后用到哪个就切换一下版本即可。
Read on →