JENKINS-18709: Support for RVM environment

Implemented support for running Ruby builds in a RVM managed environment. Includes tests.