为什么我需要在我的路径中添加〜/ .rbenv / bin?

时间:2016-10-23 03:14:56

标签: ruby bash path rbenv

我在“rbenv can't change global ruby version”中读到我需要将~/.rbenv/bin添加到我的PATH以使rbenv正常工作。

documentation中也提到了,但该目录不存在,如下所示:

➜  ~ ls -a ~/.rbenv/
.  ..  plugins  shims  version  versions

那么为什么我需要在rbenv的路径中添加一个不存在的目录?

编辑:

@theTinMan,我尝试过卸载并重新安装,但我仍然没有〜/ .rbenv / bin路径。您在文档中看到它应该在哪里?

➜  ~/D/w/t/underline-test  rbenv --version
rbenv 1.0.0
➜  ~/D/w/t/underline-test  which rbenv
rbenv () {
    local command
    command="$1"
    if [ "$#" -gt 0 ]
    then
        shift
    fi
    case "$command" in
        (rehash | shell) eval "$(rbenv "sh-$command" "$@")" ;;
        (*) command rbenv "$command" "$@" ;;
    esac
}
➜  ~/D/w/t/underline-test  cd
➜  ~  ls .rbenv
plugins  shims    version  versions
➜  ~  brew list | grep rbenv
rbenv
➜  ~
➜  ~  brew uninstall rbenv
Uninstalling /usr/local/Cellar/rbenv/1.0.0... (36 files, 61.9K)
rbenv 0.4.0 is still installed.
Remove all versions with `brew uninstall --force rbenv`.
➜  ~  brew uninstall --force rbenv
Uninstalling rbenv... (32 files, 49.9K)
➜  ~  brew install rbenv 
==> Summary
  /usr/local/Cellar/rbenv/1.0.0: 36 files, 62K
➜  ~  ls .rbenv
plugins  shims    version  versions
➜  ~  rbenv -v
rbenv 1.0.0
➜  ~  rbenv versions
  system
  2.0.0-p648
* 2.3.1 (set by /Users/max/.rbenv/version)
➜  ~

1 个答案:

答案 0 :(得分:2)

我的.zshrc

中有以下内容
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

但我只需要底线

# export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
相关问题