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
Shims are lightweight executables that simply pass your command along to rbenv. So with rbenv installed, when you run, say, rake , your operating system will do the following: Search your PATH for an executable file named rake. Find the rbenv shim named rake at the beginning of your PATH.
First, rbenv creates shims for all the commands ( ruby , irb , rake , gem and so on) across all your installed versions of Ruby. This process is called rehashing. Every time you install a new version of Ruby or install a gem that provides a command, run rbenv rehash to make sure any new commands are shimmed.
rbenv is included in all installations of Bitnami Ruby stack that use system packages. It is a command-line tool which allows you to easily install, manage, and work with multiple Ruby environments. Every installed Ruby interpreter using rbenv is isolated in its own directory with its libraries and gems.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With