January 7, 2021 / Eternal Team
Ruby is a dynamic, interpreted, reflective, object-oriented, general-purpose programming language. Ruby is most used for building web applications. However, it is a general-purpose language similar to Python, so it has many other applications like data analysis, prototyping, and making proof of concept.
Step 1: Updating System Packages
sudo yum update -y
Step 2: Installing Ruby from the YUM package manager
sudo yum install ruby
Step 3: Check the version
ruby --version
Installing Ruby using Rbenv
It is a lightweight Ruby version management utility which allows you to switch Ruby versions easily.
sudo yum install git wget gcc bzip2 openssl-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel
install rbenv and ruby-build
wget -q https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer -O- | bash
add $HOME/.rbenv/bin to our PATH by below command
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc source ~/.bashrc
rbenv -v
To see Ruby versions,
rbenv install -l
And for verification of ruby version follow below commands
ruby --version
Now you should have a fairly good idea of installing Ruby on your AWS machine. With just a few generic tweaks, you can install Ruby on any Linux distribution.