Faraday::ConnectionFailed, Connection refused - connect(2) for “localhost” port 9200 Error Ruby on Rails Faraday::ConnectionFailed, Connection refused - connect(2) for “localhost” port 9200 Error Ruby on Rails elasticsearch elasticsearch

Faraday::ConnectionFailed, Connection refused - connect(2) for “localhost” port 9200 Error Ruby on Rails


Connection refused - connect(2) for "localhost" port 9200

Looks like your elastic search service is not running. You have to make sure it's running.

To see if your elastic search service is running, run:

curl localhost:9200

If it's running, then it should return a hash like this:

{  "status" : 200,  "name" : "Buzz",  "cluster_name" : "your_cluster_name",  "version" : {    "number" : "1.4.5",    "build_hash" : "...",    "build_timestamp" : "2015-04-27T08:06:06Z",    "build_snapshot" : false,    "lucene_version" : "4.10.4"  },  "tagline" : "You Know, for Search"}

If elastic search is not running which is most likely the case for you, start it using this command:

sudo service elasticsearch start

That should fix your problem.