Xcode is constantly hijacking my Editor settings for .rb files
From the comments:


  By chance, do you use Firefox and uBlock Origin?
  
  Yes using both, why?


This is due to a mysterious bug in Firefox that is triggered by a recent update to uBlock Origin.

A fix has been applied to uBlock Origin to avoid the bug, however that patch has not made it to the latest release yet.