Skip to content

Instantly share code, notes, and snippets.

@DirtyF
Last active November 22, 2024 10:32
Show Gist options
  • Save DirtyF/5d2bde5c682101b7b5d90708ad333bf3 to your computer and use it in GitHub Desktop.
Save DirtyF/5d2bde5c682101b7b5d90708ad333bf3 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"
@desireesanchez
Copy link

I have rbenv global 2.5.3 but still unable to use the command jekyll serve
Please help.

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