rbenv rehash无法正常工作

Rem*_*min 12 ruby ubuntu ruby-on-rails rbenv

我试图在安装新的gem之后重新使用rbenv它在我的ubuntu服务器上给了我这些错误

 rbenv: cannot rehash: /home/deployer/.rbenv/shims/.rbenv-shim exists
Run Code Online (Sandbox Code Playgroud)

但.rbenv-shims不存在

reb*_*rug 20

可能是目录权限的问题:https: //github.com/sstephenson/rbenv/issues/238#issuecomment-11903292

FWIW - I also had this problem, and had to change permissions on the dir where it was checking for the .rbenv-shim... so it could write to the dir, so it stopped complaining.
Run Code Online (Sandbox Code Playgroud)

另外,尝试:

rm /home/deployer/.rbenv/shims/.rbenv-shim
Run Code Online (Sandbox Code Playgroud)

并运行:

rbenv rehash
Run Code Online (Sandbox Code Playgroud)