For various reasons, I need to build a small static site.
I’ve always wanted to try Jekyll, which is a static site generator built in Ruby.
My Debian 12 system Ruby is fine version-wise (3.1.0) but I’d like to manage it more deliberately.
I decided on rbenv to manage this process because its broadly accepted as superior to RVM.
First, let’s get our system up-to-date:
sudo apt update && sudo apt upgrade -y
As with most things Debian, its apt rbenv version is grossly out of date.
Fortunately, rbenv provides excellent instructions for manually installing directly from their github repo.
There’s also an automated installer if so desired.
Let’s stick with manual to understand what’s happening, and throw in ruby-build to facilitate ruby installation.
Here’s an easy script I found here:
cd git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
This will take a bit of time depending on your system.
Notice there are two packages being installed from github.
The echo lines print required path and initialization to the user’s .bashrc.
You can cat ~/.bashrc
to verify these are accurately copied.
The exec lines restart your shell, which instantiates the changes. Since .bashrc is the file being updated, bash is reloaded in interactive mode as opposed to login mode (exec bash -l
).
Now you can check Ruby versions and install any you would like:
list latest stable versions:
rbenv install -l
list all local versions:
rbenv install -L
install a Ruby version:
rbenv install 3.4.1
Now, on to installing Jekyll.