First try updating your ruby gems.
gem update
The problem is most likely related to your internet connection.
If you see this problem again, try
gem install rails --source http://rubygems.org
You can add a non https source forever, like this
gem sources -a http://rubygems.org
Do you want to add this insecure source? [yn]y
I want to give you one more tip:
. , UNIXy. ubuntu .