Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canonicalize symlinked paths to rbenv executable #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devstuff
Copy link

@devstuff devstuff commented Sep 19, 2023

Problem:

If rbenv-doctor is downloaded and installed locally (in the PATH), running rbenv doctor results in a warning:

Checking for `rbenv' in PATH: multiple
  You seem to have multiple rbenv installs in the following locations.
  Please pick just one installation and remove the others.
  
  /usr/local/Cellar/rbenv/1.2.0/libexec/rbenv
  /usr/local/bin/rbenv

The Homebrew installation has /usr/local/bin/rbenv symlinked to /usr/local/Cellar/rbenv/1.2.0/libexec/rbenv.

Fix:

Canonicalizing symlinks results in a single canonical path:

Checking for `rbenv' in PATH: /usr/local/Cellar/rbenv/1.2.0/libexec/rbenv

NOTE:

Running the command directly via curl, as per the README, results in a single path:

Checking for `rbenv' in PATH: /usr/local/bin/rbenv

Running the command directly as /some/path/rbenv-doctor results in a single path. When launched via rbenv is when the multiple paths are detected.

I assume this discrepancy may be related to my environment, but the canonicalized path is the correct result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant