
Question:
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
<strong>What is causing cocoapods installation to fail with the cryptic no such name (<a href="https://rubygems.org/specs.4.8.gz" rel="nofollow">https://rubygems.org/specs.4.8.gz</a>) error message?</strong>
I tried the answer from this question: <a href="https://stackoverflow.com/questions/36972339/sudo-gem-install-cocoapods-doesnt-work-on-elcapitan-10-11-4-error-could-no" rel="nofollow">'sudo gem install cocoapods' doesn't work on ElCapitan 10.11.4 , ERROR: Could not find a valid gem 'cocoapods' (>= 0) in any repository</a>
$ sudo gem install cocoapods --source http://rubygems.org
<blockquote>
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why: Unable to download data from <a href="https://rubygems.org/" rel="nofollow">https://rubygems.org/</a> - no such name (<a href="https://rubygems.org/specs.4.8.gz" rel="nofollow">https://rubygems.org/specs.4.8.gz</a>) Unable to download data from <a href="http://rubygems.org/" rel="nofollow">http://rubygems.org/</a> - no such name (<a href="http://rubygems.org/specs.4.8.gz" rel="nofollow">http://rubygems.org/specs.4.8.gz</a>)
</blockquote> Answer1:The problem was resolved by connecting to a mobile hotspot and updating ruby through that.