I switched my shell bash and noticed that zsh shell does not source /etc/profile.d.

As Zsh is at times positioned as a more advanced alternative to bash, should it not by sourcing etc profile? Now all kinds of tools are not working for example RBenv. Did I miss a step somewhere?

The Rbenv installer that I am using creates a file /etc/profile.d/rbenv.sh which seems to suggest that Zsh would also source this file

export RBENV_ROOT=/opt/rbenv
export PATH=$RBENV_ROOT/bin:/opt/rbenv/plugins/ruby_build/bin:$PATH

case $SHELL in
  source $RBENV_ROOT/completions/rbenv.zsh
  source $RBENV_ROOT/completions/rbenv.bash
  source $RBENV_ROOT/completions/rbenv.bash

eval "$(rbenv init -)"
  • 1
    Yes, zsh does not source /etc/profile.d, you can source it yourself from within ~/.zshrc. You can also use /etc/zprofile or /etc/zshrc if you like to set something system-wide. – jimmij Feb 8 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.