How to Install Ruby on CentOS 8
Ruby is one of the most famous dialects today. It has an exquisite punctuation, and it is the language behind the Ruby on Rails structure.
In this article, we will investigate various approaches to introduce Ruby on CentOS 8.
We'll tell the best way to introduce Ruby from the default CentOS 8 vaults and utilizing the Rbenv and RVM contents. Pick the establishment technique that is generally suitable for your arrangement and climate.
Installing Ruby from the CentOS repositories
This is the least demanding technique for introducing Ruby on CentOS. At the hour of composing, the form in the standard CentOS archives is 2.5.5.
Run the accompanying order as root or client with sudo benefits to introduce the ruby bundle:
sudo dnf install ruby
When the establishment is finished, you can confirm that it was effective by printing the Ruby form:
The yield will look something like this:
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
Your Ruby form may contrast from the one appeared previously.
That is it! You have effectively introduced Ruby on your CentOS framework, and you can begin utilizing it.
Install Ruby with Rbenv
Rbenv is a lightweight Ruby form the executives utility that permits you to handily switch Ruby variants.
We'll utilize the ruby-form module that expands the center usefulness of Rbenv and permit you to introduce any Ruby adaptation from source.
Start by introducing git and different conditions needed to construct Ruby from the source:
sudo dnf install git wget gcc bzip2 openssl-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel
Run the accompanying order to introduce both rbenv and ruby-form:
wget -q https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer -O- | bash
The content will clone both rbenv and ruby-form storehouses from GitHub to ~/.rbenv index.
Before beginning utilizing rbenv, you have to include $HOME/.rbenv/receptacle to your PATH .
In the event that you are utilizing Bash, type:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc source ~/.bashrc
In the event that you are utilizing Zsh type:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc echo 'eval "$(rbenv init -)"' >> ~/.zshrc source ~/.zshrc
Run the rbenv - v order to guarantee that establishment was fruitful:
To get a rundown of all Ruby forms that can be introduced with rbenv enter:
rbenv install -l
For example, if you want to install the Ruby 2.7.0 and set it as default version you would type:
rbenv install 2.7.0rbenv global 2.7.0
Verify that Ruby was properly installed by printing the version number:
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
Installing Ruby with RVM
RVM (Ruby Version Manager) is an order line instrument that permits you to introduce, oversee, and work with various Ruby conditions.
To begin with, introduce the conditions required for rvm to construct Ruby from source:
sudo dnf install curl gcc bzip2 openssl-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel
Run the accompanying orders to import the GPG keys and introduce RVM:
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB curl -sSL https://get.rvm.io | bash -s stable
To begin utilizing RVM you have to run the accompanying source order:
To get a rundown of all known Ruby variants type:
rvm list known
In the event that for instance, you need to introduce Ruby 2.6 and set it as the default rendition you would give the accompanying orders:
rvm install 2.6 rvm use 2.6 --default
Check the establishment:
ruby -v ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
For more data about how to deal with your Ruby establishments with RVM visit the RVM Documentation page .
We have given you three distinct approaches to introduce Ruby on your CentOS 8 worker. The strategy you pick relies upon your prerequisites and inclinations. Despite the fact that introducing the bundled adaptation from the CentOS vault is simpler, the Rbenv and RVM techniques give you greater adaptability for including and eliminating diverse Ruby variants on a for every client premise.
In the event that you have any inquiries or criticism, don't hesitate to remark beneath.
When composing Bash contents you will regularly need to contrast two strings with check in the event that they are equivalent or not. Two strings a...
Have you ever needed to list all clients in your Linux framework or to include the quantity of clients in the framework? There are orders to make a...
MySQL is the most famous open-source social information base administration framework. This instructional exercise depicts how to erase (or ...
Show is one of the most famous cross-stage internet browsers on the planet. It is quick, simple to utilize and make sure about program worked for t...
Java is perhaps the most well known programming dialects on the planet, used to fabricate various types of uses and frameworks. This instruc...
In this guide we'll disclose how to change a client secret key in Linux. We will likewise tell you the best way to drive clients to change thei...
The sudo order is intended to permit clients to run programs with the security advantages of another client, naturally the root client. In t...
The ip order is an incredible asset for designing organization interfaces that any Linux framework overseer should know. It is accustomed to cut in...
Apache Tomcat is an open-source execution of Java Servlet, JavaServer Pages, Java Expression Language, and Java WebSocket innovations. It is quite ...
Git is a dispersed form control framework that is being utilized by most programming groups today. It permits you to monitor your code changes, ret...
In this instructional exercise we will cover the means important to introduce the distro's default PHP 7.2 on Ubuntu 18.04 and incorporate it w...
The reverberation order is one of the most fundamental and every now and again utilized orders in Linux. The contentions passed to repeat are print...
Go, regularly alluded to as golang is a cutting edge open-source programming language made by Google. Numerous mainstream applications, including K...
Apache Tomcat is an open-source execution of the Java Servlet, JavaServer Pages, Java Expression Language, and Java WebSocket advances. It is one o...
Apache HTTP worker is the most mainstream web worker on the planet. It is a free, open-source and cross-stage HTTP worker giving incredible highlig...
Pip is a bundle the executives framework that disentangles establishment and the board of programming bundles written in Python, for example, those...
Pip is a bundle the executives framework that permits you to introduce, eliminate, and in any case oversee programming bundles written in Python. I...