Search code examples
iosrubymacosterminalcocoapods

Unable to download data from http://rubygems.org/ - timed out


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!!


Solution

  • 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.