Skip to content

Add a way to opt out from updating RubyGems

What does this merge request do and why?

When using system Ruby, RubyGems is installed as root and this makes running gdk update fail, since it tries update RubyGems without having permissions to do it, causing the whole gdk update task to fail.

This MR adds a configuration option, gdk.rubygems_update_opt_out, which allows to prevent such upgrade attempt.

Additionally, if the user did not set this option but there gem executable is not writable, we fail with an error message that let them know about that configuration option.

How to set up and validate locally

You can just run this task to execute the related task:

make platform-update

This calls directly the task that tries to update Rubygems, without resetting your gdk repos before like gdk update does because of the self-update task.

If your gem executable is user writable, you can temporarily switch its ownership to root:

sudo chown root:root $(which gem)

Then run the platform-update task, both without and with the new option.

And then of course, don't forget to chown gem again to give it back to your user. :)

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by kik

Merge request reports