Error: No such file or directory - Cannot find Elasticsearch launch script from [elasticsearch] -- did you pass a correct path?
When using ElasticSearch gems.
Ubuntu elasticsearch package changed, so no longer does which elasticsearch
return anything, which means the gem can not find the binary.
Solution: suppy command
option to ES to tell it where the binary is, either use the existing binary, mine was at /usr/shared/elasticsearch/bin/elasticsearch
, or symlink the same binary to somewhere in $PATH
or install a new version to $PATH
.
To install a new version download and untar to somewhere in $PATH
, e.g. ~/bin
You can find downloads such as this one: https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.3.tar.gz
cluster = Elasticsearch::Extensions::Test::Cluster.start(command: '/home/kris/bin/elasticsearch-1.7.3/bin/elasticsearch')
If you are using docker container to run ES, why you need to spin up the cluster? Just check if ES is accessible on test port(
localhost:9250
in my case) if yes then you can do all ES operations e.g. create/refresh/delete index from.rb
. Just make sure you expose ports while spinning up docker container.