Skip to content

RubyInstallType() incorrectly returns RbenvRuby when Ruby is provisioned via Bitrise tools: #137

Description

@markst

Problem

When a Ruby version is declared using Bitrise's tools: config in bitrise.yml, RubyInstallType() still returns RbenvRuby instead of ASDFRuby (or SystemRuby). This causes downstream steps (e.g. cocoapods-install) to attempt installing the Ruby version via rbenv, which fails because rbenv doesn't have that version — only asdf/mise does.

Root cause

Bitrise stacks have both rbenv and asdf on the PATH. RubyInstallType() appears to detect the version manager by inspecting the output of which ruby, which still resolves to an rbenv shim even when the actual Ruby was provisioned by asdf. Additionally, a .ruby-version file in the repo is picked up by rbenv, reinforcing the misdetection.

Steps to reproduce

  1. Use tools: ruby: 3.3.10 in bitrise.yml
  2. Have a .ruby-version file in the repo pointing to 3.3.10
  3. Call RubyInstallType() — returns RbenvRuby
  4. IsSpecifiedRbenvRubyInstalled() fails because rbenv doesn't have 3.3.10

Expected behaviour

RubyInstallType() should resolve the shim to its real binary path before classifying the version manager, or check which manager actually has the version available. Alternatively, asdf detection should be checked before rbenv.

Related

bitrise-steplib/steps-cocoapods-install#112

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions