From 68497a4d4b075797689264adad45bb74a1004117 Mon Sep 17 00:00:00 2001 From: Dan Nemenyi Date: Tue, 1 Dec 2020 13:57:05 +0000 Subject: [PATCH] Echo PATH to .zshenv for newer macOS's (#8483) * Add PATH to Zsh for newer macOSs Apple switched the default shell to Zsh with Catalina, so updating the PATH in .bash_profile will not have effect for relevant users, and is increasingly now the legacy approach. This commit adds instructions to echo the PATH to .zshenv, the Zsh equivalent of .bash_profile, as well as to check which version of macOS the user is using. * Update PATH in local macOS documentation --- docs/_docs/installation/macos.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/_docs/installation/macos.md b/docs/_docs/installation/macos.md index f318b592..da7e4b95 100644 --- a/docs/_docs/installation/macos.md +++ b/docs/_docs/installation/macos.md @@ -31,7 +31,14 @@ brew install ruby Add the brew ruby path to your shell configuration: ```bash +# MacOS Catalina (10.15) users and newer +echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshenv + +# MacOS Mojave (10.14) users and older echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile + +# Unsure which version of macOS you are using? Try +sw_vers -productVersion ``` Relaunch your terminal and check your Ruby setup: @@ -99,7 +106,14 @@ ruby -v Append your path file with the following, replacing the `X.X` with the first two digits of your Ruby version: ```bash +# MacOS Catalina (10.15) users and newer +echo 'export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"' >> ~/.zshenv + +# MacOS Mojave (10.14) users and older echo 'export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"' >> ~/.bash_profile + +# Unsure which version of macOS you are using? Try +sw_vers -productVersion ``` Check that `GEM PATHS:` points to your home directory: