From 7e7fefd2c1f609493f79571e9213d338f55fc47f Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 1 Nov 2023 09:00:07 -0700 Subject: [PATCH] Fix Ruby installation (#41263) Summary: Starting from Monday, Ruby jobs using Xcode 14.1 started failing on PRs but not on main. While CircleCI is investigating why this is happening, we found a way to make sure that we can install Ruby even when the cache misses. ## Changelog: [Internal] - Make sure we can install ruby 3.2.0 when rbenv cache misses. Pull Request resolved: https://github.com/facebook/react-native/pull/41263 Test Plan: CircleCI is green Reviewed By: blakef Differential Revision: D50885897 Pulled By: cipolleschi fbshipit-source-id: 9a452fd24d779cc14c86c7a8a4e3bf8ec62d0ceb --- .circleci/configurations/commands.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.circleci/configurations/commands.yml b/.circleci/configurations/commands.yml index dcfc1e548b4..70f16fe37ca 100644 --- a/.circleci/configurations/commands.yml +++ b/.circleci/configurations/commands.yml @@ -46,9 +46,14 @@ commands: echo "rbenv found; Skipping installation" fi - brew reinstall libyaml - gem install psych -- --with-libyaml-dir=$(brew --prefix libyaml) - export RUBY_CONFIGURE_OPTS=--with-libyaml-dir=$(brew --prefix libyaml) + xcode=$(xcodebuild -version | cut -d' ' -f2 | head -n 1) + # For some reason, the Xcode 14.1 machnine is already properly configured. + if [[ $xcode != '14.1' ]]; then + brew reinstall libyaml + gem install psych -- --with-libyaml-dir=$(brew --prefix libyaml) + export RUBY_CONFIGURE_OPTS=--with-libyaml-dir=$(brew --prefix libyaml) + fi + # Install the right version of ruby if [[ -z "$(rbenv versions | grep << parameters.ruby_version >>)" ]]; then