Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cocoapods not installing

What does it mean and how can I fix it:

pod install /Library/Ruby/Site/2.0.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException) from /Library/Ruby/Site/2.0.0/rubygems.rb:278:in `activate_bin_path' from /usr/local/bin/pod:22:in `<main>' 
like image 947
Nirav Hathi Avatar asked Jun 19 '16 06:06

Nirav Hathi


People also ask

How do I know if CocoaPods is installed on my Mac?

To find if Cocoapods is installed or not run cmd (pod --version). if theresult is (Not Found) Pods is not installed.


2 Answers

Using following commands, it worked for me.

  1. sudo gem uninstall cocoapods
  2. sudo gem install -n /usr/local/bin
  3. cocoapods pod install

If you encounter this error on step 2:

ERROR: While executing gem ... (Gem::CommandLineError) Please specify at least one gem name (e.g. gem build GEMNAME)

Then try this as step 2 instead (step 3 is not needed):

gem install -n /usr/local/bin cocoapods 
like image 52
Aamir Avatar answered Sep 29 '22 08:09

Aamir


If you install cocoapod using brew like me

  1. Reinstall cocoapods:

    brew reinstall cocoapods 

If you see this error message after you reinstall cocoapods by brew reinstall go to step 2.

> Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/pod Target /usr/local/bin/pod already exists. You may want to remove it:   rm '/usr/local/bin/pod'  To force the link and overwrite all conflicting files:   brew link --overwrite cocoapods  To list all files that would be deleted:   brew link --overwrite --dry-run cocoapods  Possible conflicting files are: /usr/local/bin/pod /usr/local/bin/xcodeproj 
  1. To solve conflicting files:

    brew link --overwrite cocoapods 

    Linking /usr/local/Cellar/cocoapods/1.3.1... 2 symlinks created

like image 39
stan liu Avatar answered Sep 29 '22 07:09

stan liu