SocketException: Error connecting to 127.0.0.1:27017

Is your mongod up and running on port 27017?

Is the (greater than symbol>) your os prompt or are you already connected to mongo prompt and trying mongo command again?