Skip to content

Commit

Permalink
Merge pull request #2824 from rspec/fix-build
Browse files Browse the repository at this point in the history
Allow Ruby 3.0 to use older rubygems
  • Loading branch information
JonRowe committed Feb 5, 2025
1 parent 9d5e281 commit fece159
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ group :documentation do
end

gem 'capybara'
gem 'ffi', '~> 1.15.5'
gem 'ffi', '> 1.15.5'
gem 'rake', '> 12'
gem 'rubocop', '~> 1.28.2'

Expand Down
14 changes: 13 additions & 1 deletion script/update_rubygems_and_install_bundler
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,21 @@ function is_ruby_3_plus {
fi
}

if is_ruby_3_plus; then
function is_ruby_3_1_plus {
if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then
return 0
else
return 1
fi
}


if is_ruby_3_1_plus; then
gem update --no-document --system
gem install --no-document bundler
elif is_ruby_3_plus; then
gem update --no-document --system '3.5.23'
gem install --no-document bundler
else
gem update --no-document --system '3.4.22'
gem install --no-document bundler
Expand Down

0 comments on commit fece159

Please sign in to comment.