Closed jblaty closed 3 years ago
I think this has something to do with the system-wide zprofile at /etc/zprofile
, which contains these 3 lines:
# system-wide environment settings for zsh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
That path_helper
re-order the elements in $PATH
however it wants and that appears to be arranging system-y paths such as /usr/local/bin
and /usr/bin
to the beginning.
I believe this is macOS-specific, but I wonder if other Linux distro comes with something similar by default.
Perhaps instead of ~/.zshenv
, try adding source ~/perl5/perlbrew/etc/bashrc
to the end of ~/.zshrc
or ~/.zprofile
-- according to man zsh
, those 2 ares read after /etc/zprofile
. Basically just let perlbrew rc code tweak PATH after path_helper.
OTOH the currenct on-screen instruction still mentions ~/.zshrc
and should be updated, at least when it is on macOS.
@gugod THANK YOU! This works! I will update my instructions accordingly.
@gugod THANK YOU! This works! I will update my instructions accordingly.
I ran into the same problem. Should be documented somewhere besides here, though. I'm new to zsh and only luckily found this issue buried in the "closed" queue.
I'm writing a step-by-step instruction guide to installing perlbrew on a newly built (from ISO) MacOS Big Sur (11.4) VM running on VMware Fusion.
I have been able to successfully install perlbrew. Here is what perlbrew info looks like:
perlbrew info
...Great! Now:
perlbrew switch perl-5.32.1
perlbrew info
...I'm now running the perlbrew version of Perl. Here is what the path looks like now that I've switched...
print $PATH
AWESOME! So in the path, MacOS finds the perlbrew version before the system version of Perl. Everything looks great so far, but I expect that a perlbrew switch to be persistent to each new terminal session I start. Keep in mind that I'm using zsh, and my .zshenv looks like this:
cat .zshenv
If I close that terminal session and open a new one, and then do another perlbrew info, here's what I get:
perlbrew info
...everything looks just fine, right? However, if I have another look at the path:
print $PATH
...WRONG! The perlbrew bin directories are appended to the end of the path, not the beginning as it was before I closed the terminal session, earlier.
Can anyone guide me as to: