Open noncetonic opened 11 years ago
It looks like it's having issues connecting to your elasticsearch database perhaps. Have you made sure elasticsearch is installed and running?
On OSX, you can 'brew install elasticsearch', and then to run it on demand, "launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist"
@mandreko thanks for the assist, will add those to the readme!
@connection did this solve your issue?
This works now although elasticsearch does not automatically start on login :
On Mountain Lion Running "launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist" gives me the following:
launchctl: Couldn't stat("/Users/connection/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist"): No such file or directory nothing found to load
Alright found the cause of this so I'm posting here for adding into the readme. After installing elastic search through homebrew you need to run the following command to create the appropriate symlink to the elasticsearch plist file:
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
Very interesting. I did not have to do that, as the installation of elastic search seemed to do it for me. I wonder why they are different.
I just found I had to perform the linking myself with elasticsearch v1.0.1, but after carefully reading the output of brew install elasticsearch
it does say that the link command should be called before using launchctl.
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
Including the error I got to aid people searching for a fix.
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl: Couldn't stat("/Users/mark/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist"): No such file or directory
nothing found to load
Here's what I get when running ruby app.rb
/Users/connection/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in'
from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/sinatra-1.3.3/lib/sinatra/base.rb:1306:in '
initialize': Connection refused - connect(2) (Errno::ECONNREFUSED) from /Users/connection/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in
open' from /Users/connection/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:inblock in connect' from /Users/connection/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:54:in
timeout' from /Users/connection/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:99:intimeout' from /Users/connection/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in
connect' from /Users/connection/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:755:indo_start' from /Users/connection/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:744:in
start' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient/request.rb:172:intransmit' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in
execute' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient/request.rb:33:inexecute' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/rest-client-1.6.7/lib/restclient.rb:84:in
delete' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/tire-0.5.4/lib/tire/http/client.rb:35:indelete' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/tire-0.5.4/lib/tire/index.rb:25:in
delete' from app.rb:29:inblock (2 levels) in <main>' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/tire-0.5.4/lib/tire/index.rb:8:in
instance_eval' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/tire-0.5.4/lib/tire/index.rb:8:ininitialize' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/tire-0.5.4/lib/tire/dsl.rb:102:in
new' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/tire-0.5.4/lib/tire/dsl.rb:102:inindex' from app.rb:28:in
block inclass_eval' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/sinatra-1.3.3/lib/sinatra/base.rb:1306:in
helpers' from /Users/connection/.rvm/gems/ruby-1.9.3-p194/gems/sinatra-1.3.3/lib/sinatra/base.rb:1660:inblock (2 levels) in delegate' from app.rb:22:in
Contents of my elastic.rb are just a copy of the example config