Thank you all so much for your advice! @FaeryBee I don't think I have an Emergency Vet Clinic in my area, as far as I know there are only a few regular clinics nearby and they're all closed.
I made the Pedialyte solution as suggested, and I have good news- when I replaced his water feeder that was filled with the solution, he immediately drank some of it. He didn't gag when he drank, so hopefully that's a good sign. I'm really glad I was able to get him to drink some fluids. When I had offered him plain water previously, he wouldn't drink it.
Update: Right now, Ernie's just sitting in the corner of his cage all puffed up. I think he might go to sleep (which is probably a good thing considering how tired he probably is!). Poor little guy, he looks exhausted.
No foaming/gagging as of late.