I'm quite new to Ruby in general and especially RoR, so tell me if I need to add more information.

Upon running `sudo gem install rails` (after a long delay) I receive the following error message:

```
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
no such name (https://api.rubygems.org/quick/Marshal.4.8/mime-types-1.17.2.gemspec.rz)

```

I entered the link and it downloaded something, so I tried again - not entirely surprisingly, I got the same error.

I'm running OSX 10.7.5 and I've installed XCode 4.6.3 as well as the command line tools. I've installed Ruby 2.1.0 so I know I have that up to date. I thought the error might have something to do with `sudo` typically running whatever came with the machine, but if that's true, wouldn't it give me an error saying I needed a version of Ruby >= 1.9.3?

To be perfectly clear what I'm asking: why will Rails not install under the above conditions, and how can this be remedied?

Edit: I ran the command yet another time and this time it worked, and I don't know why it didn't before or what made it work now. As a note for anyone who should care, I do have RVM installed and used it to install Ruby.