From a95c7795e334ccf72d2a78044dc31efdf092c33c Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:18:34 +0000 Subject: [PATCH] Fixes Ruby PATH bug on macOS Homebrew --- home/dot_config/shell/exports.sh.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/home/dot_config/shell/exports.sh.tmpl b/home/dot_config/shell/exports.sh.tmpl index 1a09ccd5..40788ee2 100644 --- a/home/dot_config/shell/exports.sh.tmpl +++ b/home/dot_config/shell/exports.sh.tmpl @@ -389,7 +389,11 @@ export RIPGREP_CONFIG_PATH="${XDG_CONFIG_HOME:-$HOME/.config}/ripgrep/config" ### Ruby # Add Homebrew Ruby install location to PATH (for macOS and tools that require a more recent version than the bundled system version) -export PATH="/usr/local/opt/ruby/bin:$PATH" +if [ -d /usr/local/opt/ruby/bin ]; then + export PATH="/usr/local/opt/ruby/bin:$PATH" +elif [ -d "${HOMEBREW_PREFIX:-/opt/homebrew}/opt/ruby/bin" ]; then + export PATH="${HOMEBREW_PREFIX:-/opt/homebrew}/opt/ruby/bin:$PATH" +fi export GEM_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/gems" export PATH="$PATH:$GEM_HOME/bin"