# bootstrapping with ruby-bootstrap in /opt/ruby-xxx
depends=(${depends[@]//ruby/})
depends+='ruby-bootstrap'

# install to final destination in /usr and not into /opt/ruby-xxx
eval "$(
 declare -f package | \
    sed '
      s|local _gemdir.*|local _gemdir="/usr/lib/ruby/gems/3.0.0"|g
    '
)"