Use a Sinatra app and include ActiveRecord. There are a few gotchas like making sure to clear connections at the end of requests.
https://stackoverflow.com/questions/41400202/replacing-activ...
I’d love to see more examples of picking pieces of rails and combining with other libraries.