Rails: rbenv rehash not working (rbenv-shim exists)

rbenv, ruby, ruby-on-rails, ubuntu

Solution

Might be an issue with directory permissions @ sstephenson/rbenv:

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.

Also, try:

rm /home/deployer/.rbenv/shims/.rbenv-shim

and run:

rbenv rehash

Problem

I am trying to rehash rbenv after installing a new gem it gives me these error on my ubuntu server ``` rbenv: cannot rehash: /home/deployer/.rbenv/shims/.rbenv-shim exists ``` however .rbenv-shims doesn't exists

Original source