Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbenv.plugin.zsh not working #4998

Closed
ifyouseewendy opened this issue Apr 13, 2016 · 2 comments · Fixed by #7626
Closed

rbenv.plugin.zsh not working #4998

ifyouseewendy opened this issue Apr 13, 2016 · 2 comments · Fixed by #7626

Comments

@ifyouseewendy
Copy link

I'm using homebrew to install rbenv (1.0.0), and want to use rbenv.plugin.zsh to enable ruby version display in zsh.

While fixing my issues, I've found two places to modify the current rbenv.plugin.zsh.

Issue 1

rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" "/usr/local/opt/rbenv")
if _homebrew-installed && rbenv_homebrew_path=$(brew --prefix rbenv 2>/dev/null); then
    rbenvdirs=($rbenv_homebrew_path "${rbenvdirs[@]}")
    unset rbenv_homebrew_path
fi

This section puts rbenv_homebrew_path in front of $HOME/.rbenv. It may work in previous version, but I've used homebrew to install rbenv, and rubies are installed under $HOME/.rbenv. So to make it work, I've comment out code in if section.

Issue 2

for rbenvdir in "${rbenvdirs[@]}" ; do
  if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
    FOUND_RBENV=1
    if [[ $RBENV_ROOT = '' ]]; then
      RBENV_ROOT=$rbenvdir
    fi
    export RBENV_ROOT
    export PATH=${rbenvdir}/bin:$PATH
    eval "$(rbenv init --no-rehash - zsh)"

    ...

This section is finding rubies under ${rbenvdir}/bin path, but rbenv has put all bins into shims. So to make it work, I've changed to ${rbenvdir}/shims.

@brendon
Copy link

brendon commented May 5, 2016

Yes definitely confusing. I ended up just removing it again.

@brendon
Copy link

brendon commented May 5, 2016

Also See: #3093

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants