unable to load gem cocoa pods while creating repo

岁酱吖の 提交于 2019-11-30 12:50:43

问题


rubygems/dependency.rb:296:in `to_specs': Could not find 'cocoapods' (>= 0) among 35 total gem(s) (Gem::LoadError)

from /Users/divyam.shukla/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'

from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /Users/user/.rvm/gems/ruby-2.0.0-p247/bin/pod:22:in `<main>'

I am getting this error.


回答1:


Hey I had the same problem that you have, I solve it following the next steps:

(I strongly recommend to use rvm to manage ruby versions)

  1. Remove cocoapods using gem uninstall cocoapods
  2. Install rvm, to do this I followed this steps https://rvm.io/rvm/install
  3. After that reinstall cocoapods using gem install cocoapods
  4. run pod setup

And after that everything works like a charm!.

You could notice that I didn't use sudo.

Hope it could helps you.

EDIT: If you have a slow internet connection it could take several minutes, to check the progress or steps use pod setup --verbose




回答2:


I just ran this without doing any changes using rvm.

I do have rvm version: rvm 1.25.30 (stable).

Step 1: sudo gem uninstall cocoapods

Step 2: gem install cocoapods

Step 3: pod setup

Make sure not to install with sudo.




回答3:


do this : sudo gem install -n /usr/local/bin cocoapods



来源:https://stackoverflow.com/questions/20042102/unable-to-load-gem-cocoa-pods-while-creating-repo

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