Skip to content

Instantly share code, notes, and snippets.

@DirtyF DirtyF/
Last active Jul 2, 2019

What would you like to do?
Setup Jekyll on macOS with brew and rbenv - See

First, make sure you have command line tools installed:

xcode-select --install

Then open and type:

curl | bash
set -ex
brew update
brew install rbenv ruby-build
rbenv install 2.5.3
echo "export GEM_HOME=$HOME/gems" >> ~/.bashrc
echo "export PATH=$HOME/gems/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
curl -fsSL | bash
rbenv global 2.5.3
gem install jekyll bundler
rbenv rehash
ruby -v
jekyll -v
if ! type rbenv | grep function; then
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
set +x
echo "Done! Close and reopen your terminal"

This comment has been minimized.

Copy link

commented Aug 1, 2018

I just ran the commands in, but it turns out that we should run the following command(from this answer on stackoverflow) after installing rbenv in order to make rbenv global 2.4.3 work:

# for bash:
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
# for zsh:
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
$ echo 'eval "$(rbenv init -)"' >> ~/.zshrc

Then reopen terminal.
Or the version of ruby would still be the one pre-installed on macos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.