http://www.ruby-lang.org/en/downloads/. Dependency for Ruby and Ruby on Rails : libreadline, libyaml, libxml, libssl, zlib1g. In ubuntu you can have these libraries installed via the command line ( or if you are so old fashion you may google and find the source code for these packages as well)
$sudo apt-get install build-essentails zlib1g zlib1g-dev libreadline-dev libyaml-dev libssl-devAfter installing the dependency download the source code and extract it ( please not the installation will proceed if you miss some of the dependencies but missing then would make gem, bundle, irb to not function properly). First extarct the code :
$tar -zxvf [Name of ruby source code file].tar.gzthe configure the source code
$./configurethe finally you make and install
$make && sudo make installTo check if ruby is install you can use the command
$ruby -vor try out interactive ruby (irb)
$irbNow for those who are wondering how to install the latest version of rails, use the command:
$sudo gem install rails]]>