安装后找不到pod,“pod setup”返回:无法在64个gem中找到'cocoapods'(> = 0)(Gem :: LoadError)

时间:2013-12-28 21:27:54

标签: cocoapods

使用sudo gem install cocoapods安装cocoapods后,尝试运行“pod setup”会返回此错误:

Could not find 'cocoapods' (>= 0) among 64 total gem(s) (Gem::LoadError)

“sudo gem install cocoapods”的输出:

CHANGELOG:

[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.28.0...0.29.0)
• [CocoaPods-core](https://github.com/CocoaPods/Core/compare/0.28.0...0.29.0)
• [cocoapods-downloader](https://github.com/CocoaPods/cocoapods-downloader/compare/0.2.0...0.3.0)

[ bug/enhancement notes removed for brevity]

Successfully installed cocoapods-0.29.0
Parsing documentation for cocoapods-0.29.0
1 gem installed

当我列出安装的宝石时,我没有在我的本地宝石中看到cocoapods,但我确实看到/usr/local/Cellar/ruby/2.0.0-p0/bin中列出了'pod'。

系统配置:

Mac OS 10.9 (upgraded from 10.8)
Xcode: 5.0.2 (upgrade from 4.x)
Ruby path: /usr/local/Cellar/ruby/2.0.0-p0

我怎样才能让cocopods为我工作?

6 个答案:

答案 0 :(得分:28)

从终端卸载并重新安装CocoaPods为我解决了这个问题(有关详细信息,请参阅CocoaPods documentation):

gem uninstall cocoapods
gem install cocoapods

答案 1 :(得分:15)

对我而言

sudo gem install cocoapods

答案 2 :(得分:6)

尝试:

sudo pod setup

由于您将cocoapods安装为主管(sudo),因此主管可以看到您无法看到的文件。

这也意味着在将pod添加到podFile后,您还需要运行

sudo pod install

而不是

pod install

最终撤消可可豆荚的sudo安装并使用RVM最好。

使用RVM,您可以拥有不同版本的gem集(包括不同版本的cocoapods,如果需要)。通过这条路线,您可以绕过必须以sudo运行pod命令。

答案 3 :(得分:1)

简单做这件事在终端写下面的东西.. sudo gem install -n / usr / local / bin cocoapods

答案 4 :(得分:0)

我遇到错误:

-bash:pod:找不到命令

只需为此:

sudo gem install cocoapods

答案 5 :(得分:-1)

您无需使用subseq([]) --> seq(_) . subseq([X|Xs]) --> seq(_), [X], seq(Xs), seq(_). % alternatively: seq(_), seq([X|Xs]), seq(_). seq([]) --> []. seq([X|Xs]) --> [X], seq(Xs).

安装cocapod

尝试:

sudo

然后:

gem install cocoapods

检查它是否正常