Reputation: 569
Setting up a search field on my web app. Using a gem called searchkick for this I need to install elasticsearch and java.
Installed java successfully and validated this on the Java website (using firefox) -->You have the recommended Java installed (Version 7 Update 67).
installed elasticsearch using the brew command
see code below
Neils-MacBook-Pro:yelpdemo neilpatel$ brew info elasticsearch
elasticsearch: stable 0.90.7, HEAD
http://www.elasticsearch.org
/usr/local/Cellar/elasticsearch/0.90.7 (31 files, 19M) *
Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/elasticsearch.rb
==> Caveats
Data: /usr/local/var/elasticsearch/elasticsearch_neilpatel/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_neilpatel.log
Plugins: /usr/local/var/lib/elasticsearch/plugins/
To have launchd start elasticsearch at login:
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
Then to load elasticsearch now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
Or, if you don't want/need launchctl, you can just run:
elasticsearch -f -D es.config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
When I try to launch elasticsearch using this command
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
it gives me error
launchctl: Couldn't stat("/Users/neilpatel/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist"): No such file or directory
nothing found to load
when I try
elasticsearch -f -D es.config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
I get no java is detected
Upvotes: 1
Views: 877
Reputation: 3406
Homebrew uses '/usr/local/' instead of '/Users/neilpatel/' so that you don't have to use 'sudo' when you 'brew install'... https://github.com/Homebrew/homebrew/wiki/Installation
Just replace /Users/neilpatel/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist by /usr/local/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist.
Stephane's answer shows you where the plist file is on your computer.
Upvotes: 0
Reputation: 21
After brew install elasticsearch
try
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
info obtained from: mubix/WhiteChapel
Upvotes: 1