2

我已经像那里一样安装了cocoapods

alex-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>'

有没有其他人解决过这个问题?

4

1 回答 1

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帮助了我。

于 2014-07-18T13:57:08.587 回答