Most of the times a Zlib::GzipFile::Error means RubyGems had issues parsing the response of the server.
This happens when your internet connection/configuration is behind a proxy that RubyGems is not aware of.
Please look at your internet options to determine the proxy configuration (it will look like http://user:pass@proxyserver:8080/ or similar (user, pass, proxyserver and port are examples)
Once you have that information, you can tell RubyGems to use that:
gem install rails --http-proxy=http://user:pass@proxyserver:8080
Or you can set it as environment variable:
SET HTTP_PROXY=http://user:pass@proxyserver:8080/
See gem help install for more details on the proxy documentation.
railsgem by ignoring the dependencies won't help in your work withrailssince it depends on many gems, and they need to be present. Here's the same error message in a different context, but on Windows: github.com/rubygems/rubygems-mirror/issues/14 Perhaps best to put the full error trace in the question, and hope someone gives a better answer.