Eddie Hinkle

Installing Ruby/Jekyll on macOS

I got a new laptop and as with any new laptop it is a mixture of joy and frustration. The joy is that you get to start from scratch and get rid of all the cruft that has built up on your machine. The downfall is all the little things that you forget about how you set up your machine before.

One of those snags I ran into today was reinstalling Jekyll (and by relation, Ruby). It's tricky because macOS comes preinstalled with Ruby 2.0.0 which makes you think you are all set but there are a ton of complications with it so it's better to just install your own copy of Ruby on your machine.

One of the issues was that when I tried to install Jekyll with my system Ruby, it provided the following error:

  1. ERROR: While executing gem ... (Gem::FilePermissionError). You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory

It wasn't any easier when I tried to install it using sudo. Thus, I googled and after some frustration searching I found the solution.

I'm documenting it here on my website so that I (and hopefully others) can find it easy in the future.

First you need to install Xcode.

Then, Install the Xcode Command Line Tools

  1. xcode-select --install

Open Xcode or run the following code and agree to the terms

  1. sudo xcodebuild -license

Install Homebrew

  1. /usr/bin/ruby -e "$(curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/master/install](https://raw.githubusercontent.com/Homebrew/install/master/install))"

Install Ruby

  1. brew install ruby

Install Jekyll

  1. sudo gem install jekyll

Verify Jekyll

  1. jekyll -v


posted using quill.p3k.io
Please note: This site is in an active redesign. Some things might be a little off 🧐