Mac "received invalid response to GSSAPI negotiation" with ruby pg

I did a gem install pg on my mac, and now I’m getting:

#<PG::ConnectionBad: received invalid response to GSSAPI negotiation:

received invalid response to GSSAPI negotiation:

I can’t seem to get around this issue. The way I’m connecting to CRDB is:

  PG.connect(
        user: 'root',
        dbname: db_name,
        host: db_host,
        port: db_port,
        sslmode: 'require',
        sslrootcert: "#{certs_dir}/ca.crt",
        sslkey: "#{certs_dir}/client.root.key",
        sslcert: "#{certs_dir}/client.root.crt"
    )

Also, I could not do the gem install pg w/o first installing postgres,which I did with brew. The version installed on my mac is 12

On my mac, I resolved this by doing the following.

  1. Uninstalled every Postgres version I had installed locally.
  2. brew install libpq . # note where it installed
  3. gem install pg -- --with-pg-config=/usr/local/Cellar/libpq/12.1/bin/pg_config # from 2 above.