From: "byroot (Jean Boussier)" Date: 2022-05-20T15:12:26+00:00 Subject: [ruby-core:108638] [Ruby master Bug#18792] Socket.tcp throws `getaddrinfo': no implicit conversion of Hash into String Issue #18792 has been updated by byroot (Jean Boussier). Status changed from Open to Rejected Yes, it's a keyword argument, not an option hash. ---------------------------------------- Bug #18792: Socket.tcp throws `getaddrinfo': no implicit conversion of Hash into String https://bugs.ruby-lang.org/issues/18792#change-97686 * Author: rahulroot (Rahul Gupta) * Status: Rejected * Priority: Normal * ruby -v: ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Hello, I was using ruby 2.5.3 for a while, but now it's EOL, trying to port my code to ruby 3.0.4. Same piece of code is throwing error on below code snippet. Below piece of code works fine on ruby 2.5.3, but throws error on ruby 3.0.4. I investigated socket.rb, it turns out that local_host is Hash in latest ruby, in older version it was NilClass. I have a sample running application on local VM. ``` ruby require 'socket' host = "192.168.56.100" port = 8081 socket_opts = { connect_timeout: 10, } Socket.tcp(host, port, socket_opts) ``` -- https://bugs.ruby-lang.org/ Unsubscribe: