cocoapods not installing

為{幸葍}努か 提交于 2019-11-28 04:21:25
Aamir

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

  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

Hope it helps.

x4h1d

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
Nik Kov

In my case nothing helped, then I:

  1. sudo gem uninstall cocoapods
  2. cd /Users/nikkov/.rvm/rubies/ruby-2.4.1/lib/ruby; In Finder I searched for cocoapods and removed everything.
  3. brew install cocoapods
  4. 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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!