13

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.

3
  • 1
    Doesn't look like CocoaPods is installed correctly. You might try gem uninstall cocoapods; gem install cocoapods (just to make sure you remove any remnants. Commented Nov 18, 2013 at 15:56
  • hi the cocoapods are installed correctly but when i am creating the repo for this version it gives an error and this is the error. Commented Nov 19, 2013 at 7:02
  • This tutorials help me:cocoafactory.com/blog/2013/02/01/… interworks.com/blogs/ckaukis/2013/03/05/… Commented Jan 13, 2014 at 5:38

3 Answers 3

30

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

Sign up to request clarification or add additional context in comments.

1 Comment

gem uninstall cocoapods; gem install cocoapods; pod setup worked for me. Didn't need to mess with rvm. Thanks.
8

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.

1 Comment

Make sure not to install with sudo? why?
0

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.