Skip to content

timeout: undefined method `to_sym' for :Integer #603

Closed as not planned
Closed as not planned

Description

@Deepak275

Hi Team,
I am trying to set timeout before the doing the request. I am getting

/Users/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/chainable.rb:94:in timeout': undefined method to_sym' for 3:Integer (NoMethodError)
Did you mean? to_s

Here is my code snippet:

response = HTTP.headers(params[:header]).timeout(3).get(url, body: params[:body])

Please help me with anything I am missing here

Activity

  1. ixti commented on Mar 28, 2020

    @ixti
    Member

    @Deepak275 Please update your code to run with latest stable http gem version. API of #timeout() was simplified in 4.0.0. For earlier versions you should use full-syntax, see: #446

  2. tarcieri commented on Dec 13, 2023

    @tarcieri
    Member

    Let's use #754 to track this class of errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions