- I had installed
elasticsearch@2.4
from homebrew, but the diffusiongemfile
called for version 5. As a result I was seeing errors frombundle exec rspec ./spec/workers/artist_match_worker_spec.rb
complaining about the syntax of elasticsearch queries. - I tried to
brew install elasticsearch@5.6
but the 5.6 formula had been removed in the last month :(- https://formulae.brew.sh/formula/elasticsearch@5.6 gives a 404
- the only available versions in homebrew are v6 and latest
- I ran
brew install elasticsearch@6
and tried to run the tests but there were breaking changes between 5 and 6, and I got more query errors from the same spec file. - I tried to install v5.6 again and Jon made me read the error output better. I discovered that you can still get to the deleted formula via the old git SHA, with this command:
git -C "$(brew --repo homebrew/core)" show 157167491^:Formula/elasticsearch@5.6.rb
- That will output the entire contents of that file, so I saved it to a local file:
git -C "$(brew --repo homebrew/core)" show 157167491^:Formula/elasticsearch@5.6.rb > elasticsearch@5.6.rb
- Now I could use homebrew to install the local formula:
brew install elasticsearch@5.6.rb
- note the
.rb
at the end of this command and the previous, as it distinguishes the local file from the formula within homebrew's official tap
- The output of the install mentioned that homebrew didn't create a symlink for it because it was an old/deleted version. I manually linked it with:
brew link elasticsearch@5.6 --force
- The
force
flag was necessary because it's an old/deleted version.
- The
elasticsearch@5.6
service didn't start up correctly.brew services list
showed it as started, but yellow.- I ran
cat /Users/stevenhicks/Library/LaunchAgents/homebrew.mxcl.elasticsearch@6.plist
, which is the path associated withelasticsearch@5.6
outputted bybrew services list
, to identify the location of the log file for this service. - It gave me the path
/usr/local/var/log/elasticsearch.log
. - I tried to
cat /usr/local/var/log/elasticsearch.log
but the file didn't exist. - I created the file with
touch /usr/local/var/log/elasticsearch.log
, hoping that the service would be able to tell me why it couldn't start. - I ran
brew services restart elasticsearch@5.6
to restart the service. It started up andbrew services list
showed it as green!
- I ran
- You can still get to deleted formulae
brew info
lies about where the log/data paths are.cat ...plist
(with the plist output bybrew services list
) is a more accurate way to find the log/data paths.