Matt_M
17 November 2023 11:43
1
What magic must be worked in the .zshrc file to get chruby in my user path? Works like a champ on EndeavourOS that only has a .bashrc and no .zshrc. Just adding
source /usr/share/chruby/chruby.sh
source /usr/share/chruby/auto.sh
to .zshrc isn’t working.
This guide is for Mac, but ZSH works the same everywhere. Looking at your source, you forgot to call chruby with a version argument.
Matt_M
17 November 2023 12:49
3
I added a third line with the version argument to the commands listed, pasted those rows at the bottom of .zshrc and no change.
dmt
17 November 2023 16:39
4
The contents of those files are functions, they don’t go into the PATH variable.
I just installed it from the AUR, added those lines to ~/.zshrc and, as you can see below, it does source them.
% chruby -h
usage: chruby [RUBY|VERSION|system] [RUBYOPT...]
Are you sure you’re using zsh?
echo $0
EDIT:
Have you sourced your .zshrc, or opened a new terminal?
. ~/.zshrc # . == source
Matt_M
17 November 2023 23:35
5
Thank you for that. Turns out I’m running bash but have a .zshrc file. I’ve sourced .bashrc, logged in and out, no joy.
Matt_M
18 November 2023 00:28
6
I’m getting closer. I uncommented /etc/profile.d/chruby.sh and chruby is recognized but I have to source .bashrc every time I log into the computer.
The lines at the bottom of my .bashrc are
source /usr/share/chruby/chruby.sh
source /usr/share/chruby/auto.sh
RUBIES=($HOME/.rubies/*)
and I have a .ruby-version file in my home folder.
dmt
18 November 2023 00:50
7
It just contains the first line you already added to your .bashrc.
Why? The .bashrc is sourced every time you open a terminal, assuming you’re using bash.
Please be more specific about what you’re doing and what the result is. Showing the commands and the output is the best way, were applicable.
Matt_M
18 November 2023 12:50
8
My .bashrc had two or three spaces added to the end of the file name. I removed them and all is well.
system
Closed
20 November 2023 00:50
9
This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.