# Elasticsearch-ruby, hard time to connect to cluster (5.3.0)

**URL:** <https://discuss.elastic.co/t/elasticsearch-ruby-hard-time-to-connect-to-cluster-5-3-0/84572>\
**Category:** Elasticsearch\
**Created:** [May 4, 2017, 2:07pm UTC](https://discuss.elastic.co/t/elasticsearch-ruby-hard-time-to-connect-to-cluster-5-3-0/84572 "2017-05-04T14:07:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![inbx](https://avatars.discourse-cdn.com/v4/letter/i/57b2e6/32.png) [@inbx](https://discuss.elastic.co/u/inbx)\
**Post date:** [May 4, 2017, 2:07pm UTC](https://discuss.elastic.co/t/elasticsearch-ruby-hard-time-to-connect-to-cluster-5-3-0/84572/1 "2017-05-04T14:07:03Z")

</div>

Just started using elasticsearch-ruby. I am trying to get my feet wet with a basic test, but I don't make any progress. That's what I have:

Elastic 5.3.0 in a Docker, working nicely with Kibana and curl on the console.

When I start the rails console I do the following:

> require 'elasticsearch' =\> false  
> client = Elasticsearch::Client.new log: true =\> =\> #\<Elasticsearch::Transport::Client:0x00558b5c6d58c0 arguments={:log=\>true, :logger=\>#\<Logger:0x00558b5c6d5780 @level=0, progname="elasticsearch", default\_formatter=#\<Logger::Formatter:0x00558b5c6d5730 datetime\_format=nil\>, formatter=#Proc:0x00558b5c6d54d8@/usr/local/bundle/gems/elasticsearch-transport-5.0.4/lib/elasticsearch/transport/client.rb:15, logdev=#\<Logger::LogDevice:0x00558b5c6d5690 shift\_period\_suffix=nil, @shift\_size=nil, shift\_age=nil, filename=nil........(had to remov e all @)  
> client.cluster.health =\> 2017-05-04 13:41:19 +0000: [ArgumentError] wrong number of arguments (given 1, expected 0) ({:host=\>"localhost", :port=\>9200, :protocol=\>"http"})  
> ArgumentError: wrong number of arguments (given 1, expected 0)

Whatever I do (client.search, client.health, client.index) I always get a "**[ArgumentError] wrong number of arguments (given 1, expected 0)**", so I assume something basic is wrong. Any idea what this could be?

Thanks, Tom

---

<div class="post-metadata">

**Author:** ![inbx](https://avatars.discourse-cdn.com/v4/letter/i/57b2e6/32.png) [@inbx](https://discuss.elastic.co/u/inbx)\
**Post date:** [May 4, 2017, 2:50pm UTC](https://discuss.elastic.co/t/elasticsearch-ruby-hard-time-to-connect-to-cluster-5-3-0/84572/2 "2017-05-04T14:50:34Z")

</div>

Replying to myself here, may this help somebody:

I was able to fix this problem by removing "net-http-persistent" from my Gemfile and remove the adapter: :net\_http\_persistent from client = Elasticsearch::Client.new.

This is not ideal as this kills permanent connections, but good enough for development.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 1, 2017, 2:59pm UTC](https://discuss.elastic.co/t/elasticsearch-ruby-hard-time-to-connect-to-cluster-5-3-0/84572/3 "2017-06-01T14:59:52Z")

</div>

Closed on June 1, 2017, 2:59pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
