Serverless Ruby and pg gem

I’m writing a Ruby-based lambda function that reads from S3 and writes to a Postgres database. This works fine locally. However, the lambda is unable to load the pg gem because it uses native extensions. Everything I’ve read points to using a docker image. Anyone have any suggestions? Thanks!

Have you tried the 2 ruby examples for aws?

Those two examples don’t connect to a database. My issue is the pg gem, or any gem that requires native extensions. My lambda works fine if I don’t include the pg gem and comment out the code that connects to the database.

Have you done it without the serverless framework? If you can do it straight there is no reason serverless will not work. If your ruby stuffs does not work out of the box in straight lambda you likely need to bring your own ruby distro.