https://github.com/rbenv/ruby-build
ruby-build is a command-line utility that makes it easy to install virtually any version of Ruby, from source.