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.
FFmpeg is a free and open-source assortment of devices for taking care of sight and sound documents. It contains a lot of shared sound and video li...
FFmpeg is a free and open-source order line apparatus for transcoding sight and sound records. It contains a bunch of shared sound and video librar...
A cron work is an errand that is executed at indicated spans. The errands can be planned to run by a moment, hour, day of the month, month, day of ...
Python is one of the most generally utilized programming dialects on the planet. With its basic and simple to learn punctuation, Python is a mainst...
TeamViewer is a cross-stage arrangement that can be utilized for controller, work area sharing and record move between PCs. TeamViewer is exclusive...
This article discloses how to set up a static IP address on Ubuntu 20.04. Regularly, in most organization designs, the IP address is alloted...
sudo is an order line utility that permits confided in clients to run orders as another client, of course root. This instructional exercise ...
On CentOS, the framework's timezone is set during the introduce, however it tends to be handily changed sometime in the not too distant future....
Java is one of the most well known programming dialects on the planet, utilized for building various kinds of cross-stage applications. This...
Python is one of the most well known programming dialects on the planet. With its straightforward and simple to learn grammar, Python is a famous d...
The mouseenter event permits us to set off a way of behaving when the client mouses over a component. Study this and other mouse events. Precise i...
Normally the hostname is set during the establishment of the working framework or progressively appointed to the virtual machine when it is made.&n...
Nagios is a mainstream open-source checking programming. It keeps a stock of your whole IT foundation and guarantees your organizations, workers, a...
In CodeIgniter, there is a zip library for creating a zip file but there is no library available for extracting the zip file. To extrac...
Records are one of the most ordinarily utilized information types in Python and are utilized to store assortments of things of a similar sort. ...
Apache is an open-source and cross-stage HTTP worker. It comes stacked with amazing highlights and can be additionally stretched out with a wide as...
Introduction React empowers engineers to compose reusable code as parts. This particular methodology simplifies it to create hearty applications b...
Boa constrictor is the most mainstream Python/R information science and AI stage. It is utilized for huge scope information preparing, prescient in...
In this instructional exercise, we will tell you the best way to make a bootable Ubuntu USB stick from the Linux terminal. You can utilize this USB...