Ruby, rbenv

Run Ruby projects locally on macOS without breaking system's Ruby:

Install rbenv

Assuming you already have Homebrew:

brew install rbenv

# Then list available Ruby versions, and install one:
rbenv install -l
rbenv install 3.2.10

# Set it for current project/folder:
rbenv local 3.2.10

Finally, add it to your shell's configuration file so it executes automatically:

eval "$(rbenv init -)"

Slate Docs locally

Assuming you already installed rbenv:

bundle install
bundle exec middleman build

For the official version of Slate (v2.13.1), the best and most stable Ruby version is Ruby 3.1.
While older documentation mentions Ruby 2.6 or 2.7, Slate officially dropped support for Ruby 2.5 and added formal support for Ruby 3.1 in its 2022 releases. Newer versions of Ruby (3.2+) can sometimes cause dependency conflicts with Slate's core engine, middleman, specifically regarding the nokogiri gem.

More info: https://github.com/slatedocs/slate/wiki/Using-Slate-Natively#installing-dependencies-on-macos


All CSS and HTML blades are available as a Jekyll theme.

Manually:

In you _config.yml:

remote_theme: anyblades/blades@v0.27.0-beta # or latest
plugins:
  - jekyll-remote-theme

Living example: https://github.com/anyblades/bladeswitch/blob/main/_config.yml

Preconfigured:

🥷 Bladeswitch Starter ↗  Jekyll + Pico + Blades


Jekyll tricks

Running GitHub Pages' Jekyll locally

Assuming you already installed rbenv:

  1. source "https://rubygems.org"
    
    gem "github-pages", group: :jekyll_plugins
    
  2. bundle install
    bundle exec jekyll serve
    

Living example: https://github.com/anyblades/bladeswitch/blob/main/Gemfile

More info: https://github.com/github/pages-gem#usage, https://jekyllrb.com/docs/installation/macos/


Featured by: