Ruby On Rails: Error while bundling gems

I encountered this error when I created a new rails application and tried to bundle the gems.

Fetching gem metadata from
Fetching version metadata from
Fetching dependency metadata from
Resolving dependencies...
Gem::RemoteFetcher::FetchError: Errno::ECONNREFUSED: Connection refused - connect(2) for "" port 443 (
An error occurred while installing rake (10.4.2), and Bundler cannot
Make sure that `gem install rake -v '10.4.2'` succeeds before bundling