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 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