Create a gist now

Instantly share code, notes, and snippets.

@DirtyF /README.md
Last active Apr 24, 2018

What would you like to do?
Setup Jekyll on macOS with brew and rbenv - See https://jekyllrb.com/docs/installation/#macOS

Type this into your Terminal.app:

curl https://gist.githubusercontent.com/DirtyF/5d2bde5c682101b7b5d90708ad333bf3/raw/bbac59647ac66016cf443caf7d48c6ae173ae57f/setup-rbenv.sh | bash
#!/bin/bash
set -ex
brew update
brew install rbenv ruby-build
rbenv install 2.4.3
rbenv global 2.4.3
ruby -v
gem install jekyll bundler
rbenv rehash
if ! type rbenv | grep function; then
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
fi
set +x
echo "Done! Close and reopen your terminal"
@cyberista

This comment has been minimized.

Show comment Hide comment
@cyberista

cyberista Jan 6, 2018

I get an error at the end of response to the first instruction "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing: git config --local --replace-all homebrew.private true"

Could this be something to do with Xcode? (Mac OSX 10.13 - latest update)
... thanks for any help
Cyberista

I get an error at the end of response to the first instruction "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing: git config --local --replace-all homebrew.private true"

Could this be something to do with Xcode? (Mac OSX 10.13 - latest update)
... thanks for any help
Cyberista

@DirtyF

This comment has been minimized.

Show comment Hide comment
@DirtyF

DirtyF Jan 10, 2018

Make sure you run xcode-select --install first.

Owner

DirtyF commented Jan 10, 2018

Make sure you run xcode-select --install first.

@bbookman

This comment has been minimized.

Show comment Hide comment
@bbookman

bbookman Apr 20, 2018

This is what I see at the end of the script:

  • gem install jekyll bundler
    ERROR: While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

This is what I see at the end of the script:

  • gem install jekyll bundler
    ERROR: While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
@DirtyF

This comment has been minimized.

Show comment Hide comment
@DirtyF

DirtyF Apr 21, 2018

@bbookman To avoid having to install gems as root, you can install gems in your home directory and update your path:

echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Owner

DirtyF commented Apr 21, 2018

@bbookman To avoid having to install gems as root, you can install gems in your home directory and update your path:

echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment