Skip to content

Commit

Permalink
Simplify JRuby version check
Browse files Browse the repository at this point in the history
In case shelling out to jruby fails, the error output wouldn't get printed to
stderr but ruby-build would abort.
  • Loading branch information
mislav committed Jun 10, 2024
1 parent 076d1a2 commit fb1b4da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ build_package_jruby() {
cd "${PREFIX_PATH}/bin"
ln -fs jruby ruby
chmod +x ruby
install_jruby_launcher
install_jruby_launcher "$1"
remove_windows_files
fix_jruby_shebangs
}
Expand All @@ -869,9 +869,7 @@ install_jruby_launcher() {
# shellcheck disable=SC2164
cd "${PREFIX_PATH}/bin"
# workaround for https://github.com/jruby/jruby/issues/7799
local jruby_version
jruby_version="$(./ruby -e 'puts JRUBY_VERSION' 2>/dev/null)"
[[ $jruby_version != "9.2."* ]] ||
[[ $1 != "jruby-9.2."* ]] ||
capture_command ./ruby gem update -q --silent --system 3.3.26 --no-document --no-post-install-message
capture_command ./ruby gem install jruby-launcher --no-document
}
Expand Down
1 change: 0 additions & 1 deletion test/build.bats
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,6 @@ DEF
assert_success

assert_build_log <<OUT
jruby [-e,puts JRUBY_VERSION]
jruby [gem,install,jruby-launcher,--no-document]
OUT

Expand Down

0 comments on commit fb1b4da

Please sign in to comment.