connection to postgres

I came across a problem with the database connection. A standard piece of code: "postgres://myuser:mypasswd@remoteserver/mydb" do |db|
  # code

throws an exception:
“(DB::ConnectionRefused), caused by: Cleartext auth is not supported (Exception)”

What should I add to a connection string to avoid that error?

I can connect that db using a pgAdmin4 or simple php script:

$db = new PDO("pgsql:dbname=mydb host=remoteserver", "myuser", "mypasswd");

and I have no influence on the database configuration.