I'm trying to get a project running, but anything that uses elastic search crashes with this error:
Elasticsearch::Transport::Transport::Errors::NotAcceptable: [406] {"error":"Content-Type header [] is not supported","status":406}
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/transport/base.rb:201:in `__raise_transport_error'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/transport/base.rb:312:in `perform_request'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/client.rb:128:in `perform_request'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-api-2.0.0/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-api-2.0.0/lib/elasticsearch/api/actions/indices/create.rb:84:in `create'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/index.rb:13:in `create'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/index.rb:147:in `create_index'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/index.rb:198:in `reindex_scope'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/model.rb:53:in `searchkick_reindex'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/tasks.rb:26:in `block (4 levels) in <top (required)>'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/tasks.rb:24:in `each'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/tasks.rb:24:in `block (3 levels) in <top (required)>'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/bugsnag-6.2.0/lib/bugsnag/integrations/rake.rb:16:in `execute_with_bugsnag'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/Users/bob/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:15:in `eval'
/Users/bob/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:15:in `<main>'
I've got no idea what's going on. I've installed via brew install elasticsearch@2.4
and run by brew services start elasticsearch@2.4
Any ideas?
I got there in the end. For others with this issue:
You may need a specific version of elasticsearch (I needed 2.4):
brew uninstall elasticsearch
brew install elasticsearch@2.4
pkill -f elasticsearch
# OSX specific brew services start elasticsearch@2.4
# you might need to wait a few mins curl 'http://localhost:9200/?pretty'
# this tests if elasticsearch is up and running
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.