Install Rails version depending on Ruby version.