From ca8dec78994f4e16cea19a2132cc7ebd219ad693 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 15 Feb 2025 22:58:17 +0000 Subject: [PATCH 1/2] Update ubuntu runner --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83e8056..af6a0d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ env: jobs: rubocop: name: Rubocop - runs-on: 'ubuntu-20.04' + runs-on: 'ubuntu-latest' steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 From c4a83716e5ff5c0bded928a485bd4985927137f4 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 15 Feb 2025 23:15:38 +0000 Subject: [PATCH 2/2] Avoid updating rubygems on ruby 3 --- script/update_rubygems_and_install_bundler | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 264c8d7..1dfdc1b 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -2,6 +2,20 @@ set -e -echo "Installing latest rubygems / bundler" -yes | gem update --system -yes | gem install bundler +function is_ruby_31_plus { + if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then + return 0 + else + return 1 + fi +} + +if is_ruby_31_plus; then + echo "Installing latest rubygems / bundler" + yes | gem update --system + yes | gem install bundler +else + echo "Installing rubygems 3.2.22 / bundler 2.2.22" + yes | gem update --system '3.2.22' + yes | gem install bundler -v '2.2.22' +fi