Skip to content

Instantly share code, notes, and snippets.

@vookimedlo
Last active July 7, 2017 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vookimedlo/4276b93fe3b29e85fa4df9b8865edc37 to your computer and use it in GitHub Desktop.
Save vookimedlo/4276b93fe3b29e85fa4df9b8865edc37 to your computer and use it in GitHub Desktop.
Steps to get a working Jekyll @ MacOS

Jekyll installation instruction on MacOS

MacOS is coming with a pre-installed Ruby - version 2.0.0p648 at time of writing. Jekyll requires a newer version of Ruby.

Assuming a Homebrew is installed on the MacOS.

  1. Install a rbenv to manage the Ruby installation.

    $ brew update
    $ brew install rbenv ruby-build
    
    # Add rbenv to bash so that it loads every time you open a terminal
    $ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
    $ source ~/.bash_profile
  2. Determine which stable versions are available.

    $ rbenv install --list | grep '^\s*2.4' | grep -vE 'preview|dev|rc'
    2.4.0
    2.4.1
  3. Install the new Ruby version.

    $ rbenv install 2.4.1
  4. Set the proper Ruby version to use.

    $ rbenv global 2.4.1
    $ ruby -v
    ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
  5. Update RubyRails.

    $ gem update --system
  6. Install Jekyll. A specific version could be chosen. The latest didn't work for me.

    $ gem install jekyll -v 3.4.3
  7. Install or update a bundler.

    $ gem install bundler

GitHub Pages

  1. In the Jekyll local site root directory, create a Gemfile.

     $ source 'https://rubygems.org'
     $ gem 'github-pages', group: :jekyll_plugins
  2. Install a github-pages. The bundle way will probably fail, so use gem directly.

    $ # bundle install
    $ gem install github-pages
  3. Preview the Jekyll site - will be listening on http://localhost:4000/.

    $ bundle exec jekyll serve

Sources

  1. StackOverflow #1
  2. GitHub #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment