From fd9be240ed070d2654ebf87efcfe45d0a2a0940f Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 31 Mar 2023 12:03:56 -0300 Subject: [PATCH] Fix ruby installation --- .circleci/config.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8128c5a1d..a530d204f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -355,8 +355,15 @@ commands: - run: name: Bundle Install command: | - brew update && brew upgrade ruby-build - rbenv install << parameters.ruby_version >> + # Install the right version of ruby + if [[ -z "$(rbenv versions | grep << parameters.ruby_version >>)" ]]; then + # ensure that `ruby-build` can see all the available versions of Ruby + # some PRs received machines in a weird state, this should make the pipelines + # more robust. + brew update && brew upgrade ruby-build + rbenv install << parameters.ruby_version >> + fi + rbenv global << parameters.ruby_version >> gem install bundler bundle check || bundle install --path vendor/bundle --clean