1

I have one office Mac running MacOS 10.13.2 and Ruby 2.2.1 and it is unable to install or run cocoapods via gems. sudo gem install cocoapods returns the error below. I compared the proxy and DNS configuration and it is identical to other macs that can install successfully.

▶ ping https://rubygems.org
ping: cannot resolve https://rubygems.org: Unknown host

What is causing cocoapods installation to fail with the cryptic no such name (https://rubygems.org/specs.4.8.gz) error message?

I tried the answer from this question: 'sudo gem install cocoapods' doesn't work on ElCapitan 10.11.4 , ERROR: Could not find a valid gem 'cocoapods' (>= 0) in any repository

$ sudo gem install cocoapods --source http://rubygems.org

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

Alex Stone
  • 46,408
  • 55
  • 231
  • 407
  • Possible duplicate of [gem cannot access rubygems.org](https://stackoverflow.com/questions/49800432/gem-cannot-access-rubygems-org) – Ilya Aug 29 '18 at 12:39

1 Answers1

1

The problem was resolved by connecting to a mobile hotspot and updating ruby through that.

Alex Stone
  • 46,408
  • 55
  • 231
  • 407