为什么我需要将 ~/.rbenv/bin 添加到我的路径中?
Why do I need to add ~/.rbenv/bin to my path?
我在“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=""
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)
➜ ~
我的 .zshrc
中有以下内容
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
但我只需要底线
# export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
我在“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=""
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)
➜ ~
我的 .zshrc
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
但我只需要底线
# export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"