Rbenv rehash not working

I try to rephrase rbenv after installing a new gem this gives me this error on my ubuntu server

rbenv: cannot rehash: /home/deployer/.rbenv/shims/.rbenv-shim exists 

however .rbenv pad does not exist

+8
ruby ruby-on-rails ubuntu rbenv
source share
1 answer

Perhaps there was a problem with the directory permissions: 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. 

Also try:

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

and run:

 rbenv rehash 
+16
source share

All Articles