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
- Use
tools: ruby: 3.3.10 in bitrise.yml
- Have a
.ruby-version file in the repo pointing to 3.3.10
- Call
RubyInstallType() — returns RbenvRuby
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
Problem
When a Ruby version is declared using Bitrise's
tools:config inbitrise.yml,RubyInstallType()still returnsRbenvRubyinstead ofASDFRuby(orSystemRuby). 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 ofwhich ruby, which still resolves to an rbenv shim even when the actual Ruby was provisioned by asdf. Additionally, a.ruby-versionfile in the repo is picked up by rbenv, reinforcing the misdetection.Steps to reproduce
tools: ruby: 3.3.10inbitrise.yml.ruby-versionfile in the repo pointing to3.3.10RubyInstallType()— returnsRbenvRubyIsSpecifiedRbenvRubyInstalled()fails because rbenv doesn't have3.3.10Expected 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