virtualMachineruby

Get started with rbenv

rbenv is included in all installations of Bitnami Ruby stack that use system packages. It is a command-line tool which allows you to easily install, manage, and work with multiple Ruby environments.

Every installed Ruby interpreter using rbenv is isolated in its own directory with its libraries and gems. This is convenient if you need to maintain multiple projects, dependent on different Ruby versions. It will also allow you to test your application in multiple Ruby versions so you will have a consistent environment from development, through testing, and into production.

For more information on rbenv, check the official GitHub repository.

List the installed Ruby versions

To list the installed Ruby versions in your machine with rbenv, run the following command:

$ rbenv version

You should see an output message similar to this:

* system (set by /home/bitnami/.rbenv/version)
  2.1.0

Install a Ruby version

To install a new Ruby version, use the rbenv install command:

$ rbenv install VERSION

NOTE: Replace the VERSION placeholder with an appropriate Ruby version, i.e. 2.4.0.

Use a specific Ruby version for a project

To use a specific Ruby version for a project, use the rbenv local command:

$ rbenv local VERSION

NOTE: Replace the VERSION placeholder with an appropriate Ruby version, i.e. 2.4.0.

Last modification February 9, 2023