I've just installed Ruby 2.1 using the instructions here for OSX:
https://github.com/postmodern/chruby/wiki/Ruby
Everything appears to be working fine and I've installed a few gems without issue.
However, when installing rails using:
$ sudo gem install rails -V
the installation fails part-way through with the error:
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError) no such name (https://api.rubygems.org/quick/Marshal.4.8/atomic-1.1.4-java.gemspec.rz)
I can grab a file from this URL using curl or by pasting it into the address bar, so it seems the file does exist.
Why is the installation failing?
I'm not behind a proxy and using the --no-http-proxy
flag makes no difference.
Before the error, approximately 100 other files are downloaded successfully:
HEAD https://api.rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
304 Not Modified
GET https://api.rubygems.org/quick/Marshal.4.8/rails-4.0.2.gemspec.rz
302 Moved Temporarily
GET https://aws-eu-cache01.rubygems.org/quick/Marshal.4.8/rails-4.0.2.gemspec.rz
200 OK
HEAD https://api.rubygems.org/specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
304 Not Modified
GET https://api.rubygems.org/quick/Marshal.4.8/railties-4.0.2.gemspec.rz
302 Moved Temporarily
GET https://aws-eu-cache01.rubygems.org/quick/Marshal.4.8/railties-4.0.2.gemspec.rz
... etc