Skip to content

rig fails with "No such file or directory" in user mode on macOS when ~/.local/bin does not exist #491

Closed

Description

@kevinushey

On macOS in user mode, when ~/.local/bin does not exist yet, most rig commands fail with a bare error:

$ rig list
✗ No such file or directory (os error 2)
$ rig add 4.6.1 --user
✗ No such file or directory (os error 2)

A fresh macOS user account has no ~/.local/bin, so this is the state of anyone who has not installed R with rig before (and has not had some other tool create that directory). Reproduced with rig 0.11.0 and with main (d8054fc):

H=$(mktemp -d)
HOME=$H RIG_MODE=user rig list          # fails
mkdir -p $H/.local/bin
HOME=$H RIG_MODE=user rig list          # works

Cause: find_aliases() in src/macos.rs calls std::fs::read_dir() on the binary directory without checking that it exists. sc_get_list_details() calls it for rig list, and rig add calls it through find_installed_version_arch() for the already-installed check, before anything has had a chance to create the directory (sc_set_default and sc_system_make_links create it, but they run later). The Linux and Windows versions of find_aliases() already return an empty list when the directory is missing, so this is macOS only.

Impact: RStudio now bundles rig and runs rig add <version> --user when a project asks for an R version that is not installed (rstudio/rstudio#19229). On a Mac without ~/.local/bin that install fails with the message above and nothing else to go on. Workaround until then: mkdir -p ~/.local/bin.

This is not #462, which is admin mode and rig library list, although the error text is the same.

Activity

  1. gaborcsardi commented on Oct 23, 2026

    @gaborcsardi
    Member

    Normally rig is installed in ~/.local/bin, so this does not come up. But of course it can be installed elsewhere.

  2. added
    bug
    on Oct 23, 2026
  3. github-actions commented on Nov 7, 2026

    @github-actions

    This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue

  4. locked as resolved and limited conversation to collaborators on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions