rbenv: cannot rehash: /usr/local/var/rbenv/shims/.rbenv-shim exists #759
During the rehash process, rbenv writes out the temporary file
It doesn't sound like you're running multiple
Solution: remove the file and try again.
I had this same error message on multiple servers on the same day, and in all cases deleting the file made it work again the next time.
If this is a kind of pseudo-lock file, perhaps what rbenv could do is open and actually lock the file. Then a second rbenv which comes along and sees the file could simply try to delete it before recreating it.
This has failed for me just now on an Ubuntu 16.04 server:
Relevant Ansible output:
No other commands were run in parallel. Both rbenv and ruby-build are from master as of 5 minutes ago.
After SSH'ing into the server and running
This does not seem like a user error. Seems to be a race condition in
I'm getting a similar error, not b/c the lock file gets clobbered, but b/c of the
Just test bash.
set -o noclobber echo >/dev/null
That redirections needs to be done explicity, see Safe I/O Redirection with noclobber (Unix Power Tools, 3rd Edition).
I ran rbenv doctor with the command
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
and then was told this
Checking `rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20200214)
and it worked after exporting this director to the path like this
the rbenv doctor command posted above is 404'd. here is the updated command:
alternatively, with wget