In my previous post I walked through manual installation of rbenv, ruby-build, and finally updated Ruby to its current (as of 5 January 2025) 3.4.1 release .
I now need to install Jekyll to build a small static site.
This should be fairly straightforward.
Since we’ve done a manual rbenv install, let’s follow Jekyll’s Ubuntu install instructions.
Ruby packages are commonly installed using RubyGems via the gem
binary. Fortunately for us, this is automatically installed along with Ruby.
It’s recommended that gems not be installed in the root user’s space.
So instead (if you don’t already have one) you’ll need to mkdir ~/gems
in your user’s home directory. Change permissions if needed (this wasn’t needed on my system).
Then, configure gems to use this custom directory:
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
(this reloads the interactive shell with the updated .bashrc contents)
Now simply install Jekyll (and bundler) with gem:
gem install jekyll bundler
That’s it!
You can verify the gems were installed correctly to your user’s home using ls ~/gems/gems
If not check your .bashrc to ensure your paths are correct and reload your interactive shell.
If you’re unfamiliar with Ruby, bundler manages Ruby dependencies. You can specific latest for rolling changes, though this might break your app, specify a sub-version range, or lock your deps to a specific gem version. This is all managed through a project dep configuration file.
Now, finally on to the build!