ociruby

List the installed Ruby versions

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

Approach A: Bitnami installations using system packages

Bitnami installations using system packages don’t include RVM, but rbenv. Refer to this guide for usage instructions.

Approach B: Self-contained Bitnami installations

To list the currently installed Ruby versions, execute:

$ rvm list
rvm rubies
# No rvm rubies installed yet. Try 'rvm help install'.

As the message states, if no Ruby version is installed, the list will be empty. After installing, the output will change to the below:

$ rvm list

rvm rubies
   ruby-1.9.1-p431 [ i386 ]
=* ruby-1.9.2-p320 [ i386 ]
# => - current
# =* - current && default
#  * - default

Select a Ruby from the list of installed versions

Changing the Ruby interpreter being used is as easy as executing:

$ rvm use ruby-1.9.2-p320

to use Ruby 1.9.2 (for example).

To verify the result, execute:

$ rvm list
rvm rubies
 * ruby-1.9.1-p431 [ i386 ]
=> ruby-1.9.2-p320 [ i386 ]
# => - current
# =* - current && default
#  * - default

Or simply:

$ ruby --version
ruby 1.9.2p320 (2012-04-20 revision 35421) [i386-darwin11.2.0]

It is also possible to use the system Ruby (the main Ruby installed with the Bitnami stack, not through RVM) by executing:

$ rvm use system
Now using system ruby.

Install a new Ruby version

You can get the list of all the available Ruby versions by invoking:

$ rvm list known

This will print a list like:

...
# MRI Rubies
...
[ruby-]1.8.7-head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
...
[ruby-]1.9.3-[p194]
[ruby-]1.9.3-head
ruby-head

To install a new Ruby from the list (eg. ruby-1.9.1-p431), execute:

$ rvm install ruby-1.9.1-p431

RVM will take care of downloading, unpacking and compiling the requested Ruby.

You may not find the Ruby version that you are looking for if using an outdated version of RVM. Use the following command to first update your list of available versions:

$ rvm get stable

Uninstall an existing Ruby version

You can uninstall an existing RVM-managed Ruby version by executing:

$ rvm uninstall ruby-1.9.1-p431
Last modification July 29, 2020