Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to install Jekyll using Homebrew and rbenv
# install Homebrew
$ su ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# show brew commands
$ brew help
# check current user
$ echo $(whoami)
# grant access to the folders
$ sudo chown -R $(whoami) /usr/local
$ sudo chown -R $(whoami) /Library/Caches/Homebrew/
# uninstall brew ruby
$ brew uninstall ruby
# install rbenv
$ brew update
$ brew install rbenv ruby-build
# add ~/.rbenv/bin to your $PATH for access to the rbenv command-line utility
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
# add rbenv init to your shell to enable shims and autocompletion
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
# install ruby via rbenv
$ rbenv install 2.2.3
$ rbenv global 2.2.3
$ rbenv versions
# check install path
$ which ruby
$ which gem
$ which jekyll
# rehash
$ rbenv rehash
# check ruby version and environment
$ ruby --version
$ gem env
# install bundler
$ gem install bundler
# go to the project folder
$ cd <project folder>
# install / update gems
$ bundle install
or
$ bundle update
# show installed jekyll
$ bundle show jekyll
# serve jekyll pages
$ bundle exec jekyll serve --drafts --config _config.yml,_config_dev.yml
@mcpherson

This comment has been minimized.

Copy link

@mcpherson mcpherson commented May 27, 2017

Very useful. Thanks!

@lemairecarl

This comment has been minimized.

Copy link

@lemairecarl lemairecarl commented Jun 7, 2017

It worked! I've starred this.

@petdance

This comment has been minimized.

Copy link

@petdance petdance commented Mar 9, 2019

Thanks for this. It's worked fine for me.

A couple of comments:

  1. At line 35, we do a which jekyll, but jekyll hasn't been installed yet.

  2. What exactly does rehash do? I know what it does in bash.

  3. Some of the docs were confusing, so I made updated version and put it in a gist. Consider it a pull request of a gist. https://gist.github.com/petdance/a121efa4e1ca8d1a8c371c91b9529574

Thanks again. Nice to have it all in one place.

@nathanembaye

This comment has been minimized.

Copy link

@nathanembaye nathanembaye commented Oct 30, 2020

Thanks!

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