9

I'm using a Mac Mini with Big Sur (Version: 11.2.3 (20D91)) and when running this command: sudo gem install cocoapods
I'm getting the following error

ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from http://rubygems.org/ - timed out (http://rubygems.org/specs.4.8.gz)

I don't know what to do, please help!!

Savvy
  • 489
  • 4
  • 16

4 Answers4

24

Okay I finally managed to solve it by following this steps:

  1. Disable IPv6, here's how: How to disable IPv6 in Mac OS X
  2. Restart Mac
  3. Run sudo gem install cocoapods --source http://rubygems.org in terminal without changing directories.


I hope I can help anyone facing the same issue, since I know it can be really frustrating and it takes time that could've been used by working in your projects.

Savvy
  • 489
  • 4
  • 16
3

Try downloading using homebrew

arch -arm64 brew install cocoapods

this is for arm based mac

brew install cocoapods

this is for intel mac

0

Thanks to darth_dever's answer, instead of step 3 run
sudo arch -x86_64 gem install ffi in the terminal,
then run arch -x86_64 pod install in the ios folder
that worked for me!

0

If you're facing this problem on a Linux guest machine (e.g an Ubuntu installed on VirtualBox, VMWare). Please Go to Setting -> Network -> Attached to NAT to solve the problem. Net work NAT

Luan Pham
  • 76
  • 4