How to install Ruby on Ubuntu
Method 1: Installing Ruby using the Default Package Manager
1. Update the package list
Open a terminal and update the package list to make sure you have the latest information about available packages
sudo apt update
2. Install Ruby
To install the default version of Ruby provided by Ubuntu's package manager, you can use the following command
sudo apt install ruby-full
This will install the Ruby interpreter and other related tools.
3. Check the Ruby Version
After installation, you can verify the Ruby version by running
ruby -v
It should display the installed Ruby version.
Method 2: Installing Ruby using RVM (Ruby Version Manager)
RVM is a popular tool for managing Ruby versions. Here's how to install Ruby using RVM
1. Install Dependencies
Before installing RVM, make sure you have the necessary dependencies installed
sudo apt update
sudo apt install curl gpg
2. Install RVM
Use the following command to install RVM
curl -sSL https://get.rvm.io | bash -s stable
This will download and install RVM.
3. Load RVM
To use RVM, you need to load it into your shell session. Run the following command or open a new terminal session
source ~/.rvm/scripts/rvm
4. Install Ruby
Now, you can install the desired version of Ruby using RVM. For example, to install Ruby 2.7.4, use the following command
rvm install 2.7.4
5. Set Default Ruby Version (Optional)
You can set the newly installed Ruby version as the default version using
rvm use 2.7.4 --default
6. Check Ruby Version
Verify the installed Ruby version by running
ruby -v
Now you have Ruby installed on your Ubuntu system using either the default package manager or RVM, depending on your preference.
'Linux Distributions' 카테고리의 다른 글
ip 명령어 (0) | 2024.02.17 |
---|---|
What Is My IP?(myip) (0) | 2023.10.28 |
How to install libmcrypt on CentOS 7.9 (0) | 2023.07.28 |
How to install and use stress (0) | 2023.07.09 |
How to Install Webalizer on CentOS 8 (0) | 2023.07.02 |