ERROR: http://rubygems.org/ does not appear to be a repository Error fetching remote data: Errno::ETIMEDOUT

Error happens when installing gem package using proxy

$ gem install sass
ERROR: http://rubygems.org/ does not appear to be a repository
Error fetching remote data: Errno::ETIMEDOUT: Connection timed out – connect(2) (http://rubygems.org/yaml)
Falling back to local-only install
ERROR: Could not find a valid gem ‘sass’ (>= 0) in any repository

Solution:
On RHEL/Centos:=, the variable http_proxy should have value started with ‘http://’

Working:
export http_proxy=http://192.168.1.1:3128

Not working:
export http_proxy=192.168.1.1:3128

Or we can add proxy option in gem install command:
gem install –http-proxy http://192.168.1.1:3128 sass

ERROR: http://rubygems.org/ does not appear to be a repository Error fetching remote data: Errno::ETIMEDOUT