From fc9f7798f85a56297f48785dd07685d5cbf4a1a6 Mon Sep 17 00:00:00 2001 From: Daniel Nolan Date: Fri, 23 Sep 2022 16:39:36 -0400 Subject: [PATCH] Add eval command for homebrew to zshenv (#707) * I recently setup my M1 mac and had a similar problem to this issue reported here https://github.com/thoughtbot/dotfiles/issues/702 The fix for me was to do what homebrew says after the install which is to add to or create a .zprofile with the following command `eval "$(/opt/homebrew/bin/brew shellenv)"` * Introduce a zprofile with commands to eval homebrew on mac or linux if the homebrew directory exists --- zprofile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 zprofile diff --git a/zprofile b/zprofile new file mode 100644 index 0000000..40e62a6 --- /dev/null +++ b/zprofile @@ -0,0 +1,7 @@ +if [ -d "/opt/homebrew" ]; then + eval "$(/opt/homebrew/bin/brew shellenv)" +elif [ -d "~/.linuxbrew" ]; then + eval "$(~/.linuxbrew/bin/brew shellenv)" +elif [ -d "/home/linuxbrew" ]; then + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" +fi