Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: "Could not find 'cocoapods'" while installing a Pod

I tried to use pod install in my project to implement SDK but it throws this error:

/Library/Ruby/Site/2.0.0/rubygems/dependency.rb:318:in 'to_specs': Could not find 'cocoapods' (>= 0.a) among 35 total gem(s) (Gem::LoadError) Checked in 'GEM_PATH=/Users/admin/.gem/ruby/2.0.0:/Library/Ruby/Gems/2.0.0:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0', execute gem env for more information from /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:327:in 'to_spec' from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:64:in 'gem' from /usr/local/bin/pod:22:in `'

Does anyone knows what causes and how to fix it?

like image 298
Megha Avatar asked Jan 12 '16 10:01

Megha


3 Answers

First of all Uninstall CocoaPods using sudo command.

Follow below steps :

  1. sudo gem uninstall cocoapods
  2. gem install cocoapods
  3. pod install

When you install again then do not use sudo command. You can find for sudo less installation from here.

like image 167
technerd Avatar answered Oct 19 '22 02:10

technerd


  1. Open Xcode 6
  2. Open Preferences
  3. Click the Locations tab
  4. Change the Command Line Tools version to Xcode
  5. Uninstall cocoapods
    $ sudo gem uninstall cocoapods
  6. Uninstall xcodeproj $ sudo gem uninstall xcodeproj
  7. Install xcodeproj
    $ sudo gem install xcodeproj
  8. Install cocoapods
    $ sudo gem install cocoapods
  9. Run pod --version to verify that it worked
like image 42
Ravindhiran Avatar answered Oct 19 '22 03:10

Ravindhiran


This issue is related to update Ruby. So you should apply the following steps:

  1. sudo gem uninstall cocoapods
  2. sudo gem install activesupport -v 4.2.6
  3. gem install cocoapods
like image 1
Ahmed Lotfy Avatar answered Oct 19 '22 03:10

Ahmed Lotfy