Install Jekyll in CentOS 7

Alexandru Calcatinge bio photo By Alexandru Calcatinge

Introduction

As you have seen in the previous post, installing Jekyll in Fedora was quite easy - just a couple of commands and you were done. Nevertheless, in CentOS 7 things are a little bit complicated. But not much more complicated.

The main issue is that the version of Ruby needed by Jekyll is much newer then the one available in the CentOS main repositories. But fear not, there is a solution for that. All you have to do is to install Ruby using the RVM (Ruby Version Manager). Thus you will make sure that the latest version of Ruby is available on your system.

After the last version of Ruby is installed, you will be able to install Jekyll on CentOS. Below is the installation process.

Installation process

In order to install Jekyll in CentOS, you will need to install the latest verstion of Ruby, which at the time of writing is version 2.4.1. To do this, there are two methods that I will show you.

1. First method

Run the following commands:

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable
\curl -sSL https://get.rvm.io | bash -s stable --ruby

2. Second method

Run the following commands:

curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -L get.rvm.io | bash -s stable

The output of both methods is the same - they will install the RVM package on your CentOS system.

Now that RVM is downloaded, you should run the following command:

source /etc/profile.d/rvm.sh

Now you can use RVM to install the latest version of Ruby. To do this, run the following commands:

rvm reload
rvm requirements run
rvm get stable
rvm list known
rvm install 2.4.1

Those commands will get you the latest stable version of Ruby = version 2.4.1. Now you can install Jekyll using the gem command of Ruby:

gem install jekyll
gem install bundler

That’s it! Enjoy!