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

偶尔善良 提交于 2019-12-04 15:05:51

问题


After installing cocoapods with sudo gem install cocoapods, attempting to run pod setup returns this error:

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

Output from 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

When I list the gems installed, I do not see cocoapods listed among my Local Gems but I do see 'pod' listed in /usr/local/Cellar/ruby/2.0.0-p0/bin.

System Configuration:

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

How can I get cocopods to work for me?


回答1:


Uninstalling and reinstalling CocoaPods from the Terminal fixed the issue for me (see the CocoaPods documentation for more information):

gem uninstall cocoapods
gem install cocoapods



回答2:


For me it was

sudo gem install cocoapods



回答3:


Try:

sudo pod setup

Since you installed cocoapods as supervisor (sudo), there are files that supervisor can see that you can not.

This also means that after you add a pod to a podFile, you'll also need to run

sudo pod install

instead of

pod install

It ultimately might be better to undo the sudo install of cocoa pods and use RVM.

With RVM you can have different versions of gem sets (including different versions of cocoapods, if required). By going this route, you can then bypass having to run pod commands as sudo.




回答4:


Simple do this thing write below thing in terminal.. sudo gem install -n /usr/local/bin cocoapods




回答5:


I got an Error:

-bash: pod: command not found

Just do it for this:

sudo gem install cocoapods



回答6:


you do not need to install cocapods using sudo

try:

gem install cocoapods

then:

pod

to check if it runs fine



来源:https://stackoverflow.com/questions/20819564/pod-not-found-could-not-find-cocoapods-0-among-64-total-gems-gemloa

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!