33
loading...
This website collects cookies to deliver better user experience
ruby -v
always returned that ruby 2.7.0 was not found and need to be installed. When I tried installing ruby 2.7.0 via rbenv, it said version already exists.ruby -v
outside of the project just to be sure that it was not a problem with ruby version. It took a really long time to process the command which returned with following error:/home/deploy/.rbenv/libexec/rbenv-exec: line 47: /home/deploy/.rbenv/shims/ruby: Argument list too long
rbenv rehash
. It will return the location of the file you have to delete:rbenv: cannot rehash: /home/deploy/.rbenv/shims/.rbenv-shim exists
rm /home/deploy/.rbenv/shims/.rbenv-shim
ruby -v
it will return the version of ruby currently installed in your machine.During the rehash process, rbenv writes out the temporary file .rbenv-shim to indicate that the rehash is in progress. Then, if a parallel rbenv rehash process tries to run at the same time, it will fail because the file already exists. This guards against race conditions in parallel rehashes.
It seems like .rbenv-shim file was never cleaned up after a rehash that ran earlier. That earlier process might have been killed prematurely and never cleaned up after itself.
.rbenv/shims/ruby: Argument list too long
is always to delete the ".rbenv-shim" file but hey, it's worth a try.