on OSX assure you have launched the Docker application before issuing
docker ps
or docker build
... etc ... yes it seems strange and somewhat misleading that issuing
docker --version
gives version even though the docker daemon is not running ... ditto for those other version cmds ... I just encountered exactly the same symptoms ... this behavior on OSX is different from on linux