我读入了rbenv can't change global ruby version我需要将 ~/.rbenv/bin
添加到我的 PATH 中,rbenv 才能工作。
rbenv documentation 中也提到了这一点但该目录不存在,如下所示:
$ ls -a ~/.rbenv/
. .. plugins shims version versions
那么为什么我需要添加一个不存在于我的路径中的目录才能使 rbenv
工作?
编辑:
@theTinMan,我尝试卸载并重新安装,但我仍然没有 ~/.rbenv/bin
路径。您在文档中的什么地方看到它应该在那里?
$ rbenv --version
rbenv 1.0.0
$ 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
}
$ 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 -)"
关于ruby - 为什么我需要将 ~/.rbenv/bin 添加到我的路径中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40199156/