1

So I downloaded ElasticSearch from the website and put it in my application directory and ran the command:

$ bin/elasticsearch

As the directions said but run into the error:

$ bin/elasticsearch
bin/elasticsearch: line 137: getopt: command not found
Error parsing arguments!

Its talking about this line in the file:

args=`getopt vfhp:D:X: "$@"`

What's wrong here? Anyone else have this problem?

I'm running on Windows 7, Ruby on Rails 3.1.0.

ANSWER

OK So at first I just clicked on the file:

C:\elasticsearch-0.19.8\bin\elasticsearch.bat

and it said I needed to JAVA_HOME environment variable. You can do learn how to do that here:

http://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7

Now everything is working after doing the following.

LearningRoR
  • 26,582
  • 22
  • 85
  • 150

2 Answers2

3

If you are running Windows you should run the elasticsearch.bat batch file instead of the shell script elasticsearch that you are trying to run.

javanna
  • 59,145
  • 14
  • 144
  • 125
3

While javanna's answer is correct, I just want to add that it's possible to run elasticsearch bash script using cygwin as you tried to do. You just need to install package called util-linux, which is not installed by default.

imotov
  • 28,277
  • 3
  • 90
  • 82