Ruby install script; packages+installs as a .deb or .rpm from source
First,I would like to point out that not all .deb-based distributions are as fond of sudo as Ubuntu is. For example, Debian doesn't use sudo out of the box.

It appears that you're trying to build a newer version of Ruby than is available in the stock package repository. In that case, why not make a proper .deb package with its .dsc and publish it in a private APT repository?  Then, everything integrates properly into the distribution the way package management is supposed to work, including the build process and subsequent updates.  Everyone will have a better experience when you work with the system instead of against it.