$ rvm use Using /home/owner/.rvm/gems/ruby-2.1.2 $ gem install rails ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::ECONNREFUSED: Connec
I had the same problem when trying to install premailer and upgrading ruby to current stable version (2.3.0) fixed the issue.
with rvm:
rvm install 2.3.0 rvm use 2.3.0 gem install premailer
of course, this applies to any gem, not just premailer