How can I update Ruby to 2.5.1

Glitch projects have by default Ruby 2.3.1, but an app I’m trying to build requires Ruby 2.5.1. How can I update Ruby?