ruby version code example
Example 1: rvm install new ruby version
$ ruby -v
$ rvm install ruby-X.X.X
$ rvm list
$ rvm use ruby-X.X.X
$ rvm use ruby-X.X.X --default
Example 2: how to check ruby version
// Command line:
$ ruby -v
// Within irb type "RUBY_VERSION"
// If using RVM:
$ rvm current
Example 3: ruby version from script
There is a RUBY_PATCHLEVEL constant as well. So you can get your version string as
p "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
--iltempo
Example 4: install ruby
$ sudo apt-get install ruby-full