Skip to content

Instantly share code, notes, and snippets.

@kreig303
Forked from DirtyF/README.md
Created March 3, 2020 14:24
Show Gist options
  • Save kreig303/a6895977ccc2532c67e0c8458d5ab17d to your computer and use it in GitHub Desktop.
Save kreig303/a6895977ccc2532c67e0c8458d5ab17d to your computer and use it in GitHub Desktop.
Setup Jekyll on macOS with brew and rbenv - See https://jekyllrb.com/docs/installation/macos/

First, make sure you have command line tools installed:

xcode-select --install

Then open Terminal.app and type:

curl https://gist.githubusercontent.com/DirtyF/5d2bde5c682101b7b5d90708ad333bf3/raw/fbc736fa1b50bd637929a315e6803df306c8bc8e/setup-rbenv.sh | bash
#!/bin/bash
set -ex
brew update
brew install rbenv ruby-build
rbenv install 2.6.5
echo "export GEM_HOME=$HOME/gems" >> ~/.zshrc
echo "export PATH=$HOME/gems/bin:$PATH" >> ~/.zshrc
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
if ! type rbenv | grep function; then
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
fi
source ~/.zshrc
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
rbenv global 2.6.5
gem install jekyll bundler
rbenv rehash
ruby -v
jekyll -v
set +x
echo "Done! Close and reopen your terminal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment