If ping 127.0.0.1 failed.
Maybe the localohst network is not available.
Use the command
ifconfig -a
to find if the lo is available.
ifocnfig lo 127.0.0.1
to enable it.