
Ruby is a dynamic, object-oriented programming language perfect for creating basic scripts to complex web applications. To get started, you can install Ruby on Ubuntu 24.04, which offers a modern syntax for productivity, runs with an interpreter instead of a compiler, and provides a wide range of frameworks for various projects.
This article explains how to install Ruby on Ubuntu 24.04 using rbenv and RVM.
rbenv is a Ruby version manager that allows you to install multiple versions of Ruby and switch between them. Follow the steps below to install Ruby using rbenv.
Install all required dependencies for the ruby-build plugin to download and compile Ruby.
Install the latest rbenv installation script.
Add the rbenv path to the .bashrc file.
Reload the .bashrc shell configuration to apply the path changes in your active session.
View the installed rbenv version.
Your output should be similar to the one below.
List all available Ruby versions you can install.
Note the target Ruby version in your output similar to the one below.
Install your target Ruby version. For example, 3.3.6.
The installation process may take 3-5 minutes to complete depending on the available server resources.
Set the installed Ruby version as the default if the installation is successful.
View the installed Ruby version.
Your output should be similar to the one below.
Follow the steps below to uninstall a specific Ruby version if necessary on your server.
Uninstall a specific Ruby version using rbenv. For example, 3.3.6.
Remove a specific Ruby version using RVM. For example, 3.3.6.
Uninstall Ruby using APT.
You have installed Ruby on Ubuntu 24.04 using rbenv and RVM. You can use rbenv and RVM to install multiple Ruby versions to run different projects on your server. For more information, visit the following documentation resources:
0 Comments
Be the first to comment and share your perspective with the community.