Skip to content

Instantly share code, notes, and snippets.

@krisleech
Created February 20, 2017 18:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisleech/31ee937213adb80081fe20cf20db60f2 to your computer and use it in GitHub Desktop.
Save krisleech/31ee937213adb80081fe20cf20db60f2 to your computer and use it in GitHub Desktop.
`Cannot find Elasticsearch launch script from [elasticsearch]` Error

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')
@LucasPiffer
Copy link

What if you are using docker?

@Kutomore
Copy link

@LucasPiffer did you manage to find a solution for this with docker?

@patelvp
Copy link

patelvp commented Sep 11, 2020

Anyone find a solution for this on docker?

@sudeeptarlekar
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment