Skip to content

Commit c4a8371

Browse files
committed
Avoid updating rubygems on ruby 3
1 parent ca8dec7 commit c4a8371

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

script/update_rubygems_and_install_bundler

+17-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
set -e
44

5-
echo "Installing latest rubygems / bundler"
6-
yes | gem update --system
7-
yes | gem install bundler
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+
13+
if is_ruby_31_plus; then
14+
echo "Installing latest rubygems / bundler"
15+
yes | gem update --system
16+
yes | gem install bundler
17+
else
18+
echo "Installing rubygems 3.2.22 / bundler 2.2.22"
19+
yes | gem update --system '3.2.22'
20+
yes | gem install bundler -v '2.2.22'
21+
fi

0 commit comments

Comments
 (0)