Skip to content

Commit b7c77f8

Browse files
committed
Add more combinations to bundle install
1 parent 7a1345f commit b7c77f8

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

script/update_rubygems_and_install_bundler

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
set -e
44

5+
function is_ruby_31_plus {
6+
if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then
7+
return 0
8+
else
9+
return 1
10+
fi
11+
}
12+
513
function is_ruby_23_plus {
614
if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then
715
return 0
@@ -10,9 +18,14 @@ function is_ruby_23_plus {
1018
fi
1119
}
1220

13-
if is_ruby_23_plus; then
14-
gem update --system
15-
gem install bundler
21+
if is_ruby_31_plus; then
22+
echo "Installing rubygems 3.3.6 / bundler 2.3.6"
23+
yes | gem update --system '3.3.6'
24+
yes | gem install bundler -v '2.3.6'
25+
elif is_ruby_23_plus; then
26+
echo "Installing rubygems 3.2.22 / bundler 2.2.22"
27+
yes | gem update --system '3.2.22'
28+
yes | gem install bundler -v '2.2.22'
1629
else
1730
echo "Warning installing older versions of Rubygems / Bundler"
1831
gem update --system '2.7.8'

0 commit comments

Comments
 (0)