Introduction

Ruby on Rails is a popular web application framework written in Ruby. rbenv is a lightweight Ruby version management tool that allows you to easily install and manage multiple Ruby versions. In this guide, we'll walk through the steps to install Ruby on Rails with rbenv on Ubuntu 22.04.

Prerequisites

Before proceeding, ensure you have:

  1. An Ubuntu 22.04 server or desktop environment
  2. Basic knowledge of using the command line

Steps to Install Ruby on Rails with rbenv

    1. Install rbenv: Install rbenv and its dependencies:
sudo apt update
sudo apt install rbenv ruby-build
    1. Set Up rbenv: Initialize rbenv by adding it to your shell's profile configuration:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
    1. Install Ruby: Use rbenv to install the desired version of Ruby:
rbenv install 
    1. Set Global Ruby Version: Set the global Ruby version for your user:
rbenv global 
    1. Install Rails: Install Ruby on Rails using the gem package manager:
gem install rails
    1. Verify Installation: Verify that Ruby and Rails have been installed correctly:
ruby -v
rails -v

Conclusion

Congratulations! You have successfully installed Ruby on Rails with rbenv on your Ubuntu 22.04 system. You can now start developing web applications using Ruby on Rails and leveraging its powerful features and ecosystem.

Was this answer helpful? 0 Users Found This Useful (0 Votes)