This project is a Jekyll site. On Ubuntu, Debian, and their derivatives (like Linux Mint, Pop!_OS, and Elementary OS), setting up the environment involves installing Ruby, build tools for compiling native gem extensions (like sassc), Bundler, and configuring your environment to install packages without root permissions.
To run this project locally, you need:
- Git
- Ruby (and its development headers)
- GCC / Make (build tools)
- Bundler
- Node.js & npm (optional, for local linting/CI checks)
Follow these steps to set up the development environment on your Ubuntu or Debian system.
Make sure your package manager's cache is up to date:
sudo apt updateInstall Ruby, compilation tools, and other libraries required to build native gem extensions:
sudo apt install -y git ruby-full build-essential zlib1g-dev libffi-dev libssl-dev nodejs npmNote: ruby-full includes the Ruby interpreter, development headers (ruby-dev), and standard libraries required to compile C-extension gems.
By default, running gem install requires sudo privileges because it tries to write to system directories. To avoid using sudo (which can lead to file ownership issues and security risks), configure RubyGems to install gems to your home directory:
-
Create a directory for your local gems:
mkdir -p ~/gems -
Add environment variables to your shell configuration file (e.g.,
~/.bashrc,~/.zshrc):echo '# Custom Ruby Gem path' >> ~/.bashrc echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
-
Reload your terminal settings:
source ~/.bashrc
Install Bundler to manage the project's dependencies:
gem install bundlerVerify that Bundler is installed and accessible:
bundle --versionClone the project and enter the repository directory:
git clone https://github.com/riffpointer/riffpointer.github.io.git
cd riffpointer.github.ioNote: If you have already cloned the repository, navigate to the folder in your terminal.
Install the Ruby gems specified in the Gemfile:
bundle installThis will compile and install all required gems locally.
Start the local Jekyll server:
bundle exec jekyll serveOnce the server starts, you can view the site by navigating to:
http://localhost:4000
To include draft posts in your local build, run:
bundle exec jekyll serve --draftsIf port 4000 is already in use by another application, specify an alternative port:
bundle exec jekyll serve --port 4001Before pushing changes to GitHub, you can run the primary markdown linting checks locally to match what runs in the GitHub Actions CI pipeline:
bundle exec jekyll build
npx --yes markdownlint-cli2- Cause: Ruby is trying to install gems globally in
/var/lib/gems/which requires root access. - Solution: Follow Step 3 to set up a local
GEM_HOMEin your home directory, or run the command withbundle install --path vendor/bundle(though settingGEM_HOMEis generally preferred for a cleaner global-user workflow).
- Cause: The compiler headers for Ruby or development libraries are missing.
- Solution: Ensure you have installed
ruby-full(orruby-devexplicitly) andbuild-essential. Run:sudo apt install -y ruby-dev build-essential
- Cause: The executable is not in your system
PATH, or you tried to runjekylldirectly instead of via Bundler. - Solution: Always run commands prefixed with
bundle exec(e.g.,bundle exec jekyll serve), and ensure yourPATHincludes~/gems/binas described in Step 3.
- Configuration: System configuration is defined in
_config.yml. - Posts: Markdown files for blog posts live in
_posts/. - Layouts: Page structures live in
_layouts/. - Includes: Reusable HTML/Liquid components live in
_includes/.
- Update your local branch:
git pull - Update dependencies (if changed):
bundle install - Launch local server:
bundle exec jekyll serve - Preview and test your changes in the browser.
- Check markdown formatting:
npx --yes markdownlint-cli2 - Commit and push your changes.