Rbenv & available ruby versions in stack

After the release of Mac OS Catalina I’ve started to use rbenv again.

Some workflows which use Gems are failing in Bitrise, is it possible to use rbenv to set a specific version of Ruby for each workflow?

I’m using the 2.6.5 though, I see by default, in the Stack is used the 2.6.3, how would I be able without rbenv to tell Bitrise to use the 2.6.5 already included in “osx-xcode-11.2.x”

https://github.com/bitrise-io/bitrise.io/blob/master/system_reports/osx-xcode-11.2.x.log

=== Ruby and rubygems ==================
* Ruby (default): ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
--- Available ruby versions ---
  system
  2.4.5
  2.4.9
  2.5.3
  2.5.7
* 2.6.3 (set by /Users/vagrant/.rbenv/version)
  2.6.5

@Ian.Magarzo assume you might of solved this by now but if not… I was able to bump the version of Ruby used in one of my projects by added a .ruby-version file with the version I wanted to use i.e 2.6.5.

The gotcha here is that rbenv in the Vagrant might not have 2.6.5 as a known version to install. If this is the case you should add a brew install task to install rbenv and make sure update/upgrade is set to yes. This will also update ruby-build which will update the list of installable Rubies.

2 Likes

Just a note: rbenv is now preinstalled on all Mac stacks, so in most cases no brew upgrade required at all, but if it would be (if you’d want to use a future ruby version) this should do the trick:

brew upgrade rbenv ruby-build

( https://github.com/rbenv/rbenv#upgrading-with-homebrew )

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.