我已经安装了像there
这样的cocoapodsalex-z:~ alex-z$ /usr/bin/gem list --local | grep "cocoapods"
结果为空
alex-z:~ alex-z$ sudo !!
结果是
cocoapods (0.33.1)
cocoapods-core (0.33.1)
cocoapods-downloader (0.6.1)
cocoapods-plugins (0.2.0)
cocoapods-trunk (0.1.4)
cocoapods-try (0.3.0)
接下来
alex-z:~ alex-z$ /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/gem list --local | grep "cocoapods"
alex-z:~ alex-z$ sudo !!
结果与先前命令的结果相同
当我尝试使用pod
时,我收到错误
alex-z:~ alex-z$ pod --version
/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 87 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>'
还有其他人解决了这个问题吗?
答案 0 :(得分:1)
我在/ usr / bin / ruby(2.0.0-p195)和/System/Library/Frameworks/.../ruby(2.0.0-p481)中有不同版本的ruby。 rvm upgrade 2.0.0-p195 2.0.0-p481
帮助了我。