Installing Ruby

Jekyll is written in Ruby, so the first step is to get the Ruby language environment.

Install Ruby using rbenv

Like python has pip, Ruby has an environment manager called rbenv, that makes it easier to install and manage Ruby versions.

You can find installed Ruby versions at ~/.rbenv/versions/
rbenv intercepts calls to ruby executables, checks the Ruby version set in your project_dir/.ruby-version and targets the appropriate Ruby installation.

# Install latest rbenv by cloning the repo
mkdir ~/.rbenv
git clone https://github.com/rbenv/rbenv.git ~/.rbenv

# set up shell to load rbenv
~/.rbenv/bin/rbenv init
  • *Install the Ruby pre-requisite dependencies
sudo apt-get install autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev
# consumes ~581 MB
  • Install Ruby
# list available ruby versions
rbenv install -L

# If that fails (no such command):
# install the ruby-build plugin by cloning the repo
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
# placed at ~/.rbenv/plugins/ruby-build

# listing Ruby versions should now succeed. I picked the latest for install:
rbenv install 3.4.4
# tar.gz download: 22 Mb. Install takes: 149 Mb

#set as global:
rbenv global 3.4.4

Now, follow the Jekyllrb guide for installing Jekyll