pg gemでは、番号付きのプレースホルダー($1)を使用する必要があります 、$2 、...)位置プレースホルダーではなく(? ):
conn = PG.connect(:dbname => 'db1')
conn.prepare('statement1', 'insert into table1 (id, name, profile) values ($1, $2, $3)')
conn.exec_prepared('statement1', [ 11, 'J.R. "Bob" Dobbs', 'Too much is always better than not enough.' ])
細かいマニュアル 言うことは次のとおりです:
また、 exec_prepared
: