【发布时间】:2016-06-02 14:01:48
【问题描述】:
当我启动终端时,我收到以下消息:
/usr/lib/rbenv/libexec/../completions/rbenv.bash:16: command not found: complete
~ %
其他一切看起来都很正常。我在运行 tmux 时没有收到消息,只有在我启动新终端时才收到消息。
这是我的 ~/.zshrc 文件:
# load custom executable functions
for function in ~/.zsh/functions/*; do
source $function
done
# extra files in ~/.zsh/configs/pre , ~/.zsh/configs , and ~/.zsh/configs/post
# these are loaded first, second, and third, respectively.
_load_settings() {
_dir="$1"
if [ -d "$_dir" ]; then
if [ -d "$_dir/pre" ]; then
for config in "$_dir"/pre/**/*(N-.); do
. $config
done
fi
for config in "$_dir"/**/*(N-.); do
case "$config" in
"$_dir"/pre/*)
:
;;
"$_dir"/post/*)
:
;;
*)
if [ -f $config ]; then
. $config
fi
;;
esac
done
if [ -d "$_dir/post" ]; then
for config in "$_dir"/post/**/*(N-.); do
. $config
done
fi
fi
}
_load_settings "$HOME/.zsh/configs"
# aliases
[[ -f ~/.aliases ]] && source ~/.aliases
alias sz='source ~/.zshrc'
# Local config
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
# rbenv config
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/bin:$PATH"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
这是什么原因造成的,我该如何摆脱它?我可以成功调用我的 Ruby 版本,并且我已经运行了 rbenv init 和 rbenv rehash。
rbenv version
2.3.0 (set by /home/drempel/.rbenv/version)
ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
【问题讨论】:
-
complete是一个与可编程完成相关的 Bash 内置函数; Zsh 没有。听起来 Zsh 正在评估为 Bash 编写的东西。 -
感谢您提供的信息,这对您有帮助!我发现我的问题不是 rbenv。尽管描述并修复了我的确切问题 [github.com/rbenv/rbenv/issues/487](here),但不幸的是,它不适用于我的具体情况。我开始一次删除一个部分并保存我的 ~/.zsh 文件,直到错误停止出现,我将问题缩小到 _load_settings() {...}