RubyGems hangs while updating the source index


RubyGems hangs while updating the source index.
I tried to execute:
gem install rails --include-dependencies
but the command freezes at the following message:
“Updating Gem source index for:

Is there anything I’m doing wrong?


Most of the time a firewall is to blame here. If you have a firewall
try disabling it and then see if you can successfully install gems. If
there is still a problem you may have to go as far as uninstalling
your firewall. I’m assuming you are on Windows since that is normally
where this problem occurs.

The problem is not with Ruby but with certain Windows firewall products.