You must use "$1" as the placeholder for bind parameters (not "?"). It should work like this:
c=PGconn.new
c.exec("CREATE TEMP TABLE bigint_test (big bigint)")
c.exec_params("INSERT INTO bigint_test (big) VALUES ($1) RETURNING big", [364834158948831939]).to_a # => [{"big"=>"364834158948831939"}]
c.exec_params("SELECT * FROM bigint_test WHERE big=$1", [364834158948831939]).to_a # => [{"big"=>"364834158948831939"}]
c.exec_params("SELECT $1::bigint", [364834158948831939]).to_a
# => [{"int8"=>"364834158948831939"}]
If the PostgreSQL server can not find the parameter type from the column type, you need to cast the value as "$1::bigint", as seen in the last line above.
Hope this helps.