Skip to content

Commit 2bdca15

Browse files
authored
Merge pull request #2824 from rspec/fix-build
Allow Ruby 3.0 to use older rubygems
2 parents 609bb83 + decfd72 commit 2bdca15

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ group :documentation do
1212
end
1313

1414
gem 'capybara'
15-
gem 'ffi', '~> 1.15.5'
15+
gem 'ffi', '> 1.15.5'
1616
gem 'rake', '> 12'
1717
gem 'rubocop', '~> 1.28.2'
1818

script/update_rubygems_and_install_bundler

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,21 @@ function is_ruby_3_plus {
1111
fi
1212
}
1313

14-
if is_ruby_3_plus; then
14+
function is_ruby_3_1_plus {
15+
if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then
16+
return 0
17+
else
18+
return 1
19+
fi
20+
}
21+
22+
23+
if is_ruby_3_1_plus; then
1524
gem update --no-document --system
1625
gem install --no-document bundler
26+
elif is_ruby_3_plus; then
27+
gem update --no-document --system '3.5.23'
28+
gem install --no-document bundler
1729
else
1830
gem update --no-document --system '3.4.22'
1931
gem install --no-document bundler

0 commit comments

Comments
 (0)