I am creating a video that shows how to set up the dev environment for Jekyll. I am using the official Jekyll documentation as a reference, which is located here:
As per the Jekyll documentation, you need to type the following command (there’s a different one for BASH). I believe that I used the following command when I originally set up my dev environment as well:
However, when you install Homebrew and then install the latest version of Ruby with brew install ruby, Brew performs the Ruby installation, and once complete, there is a message that looks like this:
If you need to have ruby first in your PATH, run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc
My question is, should you do one or both of these commands? If just one, is it the Jekyll recommended line or the Brew/Ruby recommended line?
I’m really sorry. I appreciate your both helping me. I know so little about Ruby and all my external reading about these paths seems to expect the reader to know a lot more than I do (I’m using Ruby to use Jekyll, not to use Ruby).
Maybe I could ask the question differently: are the Ruby docs correct, is my method correct, or are both correct?
Please keep in mind this is purely for the purposes of developing Jekyll locally, not for coding in Ruby.
The Jekyll docs are correct. Use that one and don’t do both (since part of the logic is duplicated. note the start of the parts are identical).
If you follow the Brew help you’ll only have Ruby itself accessible.
If you follow the Jekyll docs, you’ll have access to run custom Ruby and be able to run custom gems that you install.
The custom Ruby has a custom gem location. Both are separate from the system Ruby and system gems (which are frozen from Catalina). So you need to tell the shell about both paths so you can use Ruby correctly, whether for Jekyll or plain Ruby.