This document outlines the steps to set up and run the Jekyll-based website in a local development environment. We will use rbenv to manage the Ruby version.
Before you begin, make sure you have the following installed on your system:
- Homebrew (for macOS users): A package manager for macOS. If not installed, you can get it from brew.sh. For Linux, use your distribution's package manager (e.g.,
apt,yum). - Git: For version control.
- A Code Editor: Such as Visual Studio Code, Sublime Text, or Atom.
rbenv allows you to manage multiple Ruby versions on your machine.
-
Install
rbenvandruby-build:- On macOS with Homebrew:
brew install rbenv ruby-build
- For other systems, please follow the official
rbenvinstallation guide.
- On macOS with Homebrew:
-
Initialize
rbenv: Add the following line to your shell's configuration file (e.g.,~/.zshrc,~/.bash_profile, or~/.bashrc):eval "$(rbenv init -)"
Then, restart your terminal for the changes to take effect.
-
Install Ruby: GitHub Pages, which this site is compatible with, currently recommends Ruby 3.1.x. Let's install a recent stable version.
rbenv install 3.1.4
-
Set the Local Ruby Version: Navigate to your project's root directory (
/home/user/murriel.github.io) and set the Ruby version for this project:cd /home/user/murriel.github.io rbenv local 3.1.4
This will create a
.ruby-versionfile in your project directory.
We will use Bundler to manage the Ruby gems (dependencies) for the project.
-
Create a
Gemfile: AGemfileis missing from the project. Create a new file namedGemfilein the root of your project (/home/user/murriel.github.io/Gemfile) with the following content. Thegithub-pagesgem conveniently includes Jekyll and all other dependencies used by GitHub Pages.source "https://rubygems.org" gem "github-pages", group: :jekyll_plugins
-
Install Bundler: Bundler is a gem that manages other gems.
gem install bundler
-
Install Gems: Now, use Bundler to install all the gems specified in your
Gemfile.bundle install
With all the dependencies installed, you can now serve the website locally.
-
Start the Server: Run the following command from your project's root directory:
bundle exec jekyll serve -
View Your Site: Jekyll will build your site and start a local web server. You can view your website by opening your web browser and navigating to:
The server will automatically watch for changes to your files and regenerate the site when you save them.
- macOS Command Line Tools: If you encounter errors during gem installation on macOS, you might need to install the Xcode command-line tools:
xcode-select --install
- Google Maps API Key: The file
_includes/js.htmlcontains a Google Maps API key. Please be aware that this key is exposed. For a production site, it's highly recommended to restrict the API key to your domain to prevent unauthorized use.