Last Updated: 2022-05-26
chromedriver failed to run today, and I had difficulty debugging. The
central issue was that it was installed as an
rbenv shim and I didn't
understand how these shims worked.
Being at the front of the PATH, i.e. leftmost, means the shim gets run before anything else.
The code above simply means there is a folder
~/.rbenv/shims that has a bunch
of commands. Usually these intercept calls to underlying commands of the same
For example, the folder had about 100 commands, such as
one such command is called, the shim figures out the correct ruby version for the
"Through a process called rehashing, rbenv maintains shims in that directory to match every Ruby command across every installed version of Ruby, gem, rake, rails, ruby, and so on."
So there are ruby commands from various ruby versions, some of which may have
compatibility issues with the codebase I was debugging. I saw, for example, that
chromedriver said it was for ruby 2.5, even though my project was ruby 2.5.3.
By removing this shim (by means of wiping the no-longer-needed install of ruby
2.5), the problem was remedied.
rbenv rehash may be necessary