Incomplete Foreman Installation

Hi,

I was trying to install the foreman 1.5 in ubuntu trusty environment.
Everything went fine till the installation process stucks at 99%, and it is
not moving forward. When I checked the error logs at
/var/log/foreman-installer.log it shows

Fetching source index from https://rubygems.org/

Could not fetch specs from https://rubygems.org/

I consulted with IRC and they recommended to purge "ruby-foreman-bootdisk"
and "ruby-foreman-setup" . I purged the mentions packages and again ran
foreman-installer but exactly it was throwing the same problem. When I
tried to ping https://rubygems.org/ it was saying connection refused. Any
suggestions? Thanks in advance.