Similar to what we do for python (e.g. protocolbuffers/upb@248ed86), we should handle the missing ruby case more smoothly. As it's implemented right now, the WORKSPACE setup will break the entire protobuf repo when ruby isn't found. Instead, we should make ruby optional and only fail when ruby targets are requested
Right now we build hermetic ruby installations during repo initialization. If we switch to only downloading the source code and modeling the build in Bazel though, it could significantly improve devex here and allow us to support multiple versions practically. The key piece is that we wouldn't have access to non-system executables in repo rules, so the toolchain setup and ruby_bundle would need to be tweaked
This is an intermediate step to full Bazelification of Ruby, where we can expand the "system" toolchain support. With this setup, any system installations via rvm or rbenv will take precedence over downloading and building from source