PG::UnableToSend: server closed the connection unexpectedly

Did you try it more than once and get the same error at the same place?