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>'
Use following commands, and It works for you.
1: sudo gem uninstall cocoapods
2: sudo gem install -n /usr/local/bin cocoapods
3: pod install
If you install cocoapod using brew like me
- 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
- To solve conflicting files
brew link --overwrite cocoapods
> Linking /usr/local/Cellar/cocoapods/1.3.1... 2 symlinks created
Hope it helps.
Uninstall the existing cocoapods
, if any, by following command:
gem list --local | grep cocoapods | awk '{print $1}' | xargs sudo gem uninstall
Then install it to /usr/local/bin
instead of /usr/bin
using following command:
sudo gem install -n /usr/local/bin cocoapods
For further query, check this link to uninstall and this link to install cocoapods.
Try sudo gem update
- After remove cocoapods
- -Install cocoapods
In my case nothing helped, then I:
sudo gem uninstall cocoapods
cd /Users/nikkov/.rvm/rubies/ruby-2.4.1/lib/ruby
; In Finder I searched forcocoapods
and removed everything.brew install cocoapods
brew link --overwrite cocoapods
(if needed)
When I tried @Aamir's solution, I ran into the error:
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why: Unable to download data from https://rubygems.org/ - no such name (https://api.rubygems.org/specs.4.8.gz)
This worked for my Mac:
sudo gem uninstall cocoapods
sudo gem install cocoapods
来源:https://stackoverflow.com/questions/37904588/cocoapods-not-installing