How to Create a Jekyll® Ruby Application


Last modified: February 22, 2024

Overview

This document describes how to install the Jekyll web application. The Jekyll® application is a static website generator that functions on the Ruby platform.

Warning:
  • Because WebPros International, LLC doesn’t develop or ship Jekyll, cPanel Technical Support can’t help you with this process.
  • We recommend that only experienced system administrators perform these steps.
  • We are not responsible for any data loss.
Note:
  • We recommend that you perform the steps in this document via the command line as a cPanel user unless otherwise specified.

  • You can also perform these steps in cPanel’s Terminal interface (cPanel » Home » Advanced » Terminal).

  • You do not need to register the Jekyll application’s configurations in cPanel’s Application Manager interface (cPanel » Home » Software » Application Manager).

  • To use this feature, the cPanel account must possess compiler access in WHM’s Compiler Access interface (WHM » Home » Security Center » Compiler Access). If the account does not possess compiler access, the system will return an error similar to the following message:

make: execvp: gcc: Permission denied
  • In this document, hyde represents the application’s name.

For more information, read Jekyll’s documentation.

Install Jekyll

Pre-installation settings

Before you begin, make certain that your system has the most recent version of rubygems. To update rubygems to the latest version, run the following command as the root user:

source /opt/cpanel/ea-ruby27/enable && gem update --system

Additionally, make certain that the following EasyApache 4 RPMs exist on your server:

If you need to install these RPMs, use WHM’s EasyApache 4 interface (WHM » Home » Software » EasyApache 4) or run the following command as the root user:

yum install ea-ruby27-mod_passenger ea-ruby27-ruby-devel

Install the bundler and jekyll gems

Note:

Installing the bundler as a non-root user will cause the application to fail. If the /bin/bundler directory exists in a user’s home directory, it was not installed by the root user.

To install the bundler and jekyll Ruby gems, run the following command as the root user:

scl enable ea-ruby27 'gem install bundler jekyll'

If you do not wish to use the scl utility, perform the following steps to install the bundler Ruby gem:

  1. Log in to the server as a cPanel user.

  2. Add the following line to your shell’s rc file (for example, /home/user/.bashrc file):

source /opt/cpanel/ea-ruby27/enable
  1. Log out of your terminal session, and log back in again.

    Note:
    You can also create an additional terminal session.

  2. Run the gem install bundler jekyll command.

Create your jekyll website

After you install the bundler and jekyll Ruby gems, create your application. To do this, run the following command in your current directory:

scl enable ea-ruby27 'jekyll new hyde'

Build and deploy the application

After you create the application, build the application and deploy it. To do this, change to the /hyde directory and run the following command:

scl enable ea-ruby27 'jekyll build --baseurl '/hyde' --destination ~/public_html/hyde'

After you run this command, navigate to the new site in a web browser with the following url:

http://example.com/hyde
Note:

In this example, example.com represents your website.

Additional Documentation