Detect Ruby version mismatch between mise and PATH in gdk doctor
Problem
During a debugging session with @psjakubowska, we found that which ruby and mise current ruby both showed 3.3.9, but PATH pointed to 3.2.9. Gems got installed to 3.3.9 but loaded from 3.2.9, which caused this error:
<internal:/Users/foo/.local/share/mise/installs/ruby/3.2.9/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:139:in `require': cannot load such file -- terminal-table (LoadError)
Implementation
Add a check to gdk doctor that detects when mise's Ruby version doesn't match what's in PATH. This would catch the misconfiguration before users run into gem load errors.
Impact
Users get confusing gem load errors even though the gems appear to be installed correctly.
Impacted categories
The following categories relate to this issue:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Steps to replicate (optional)
Proposal (optional)
Environment (optional)
- Operating system name:
<!-- output of `uname -a` command --> - Architecture:
<!-- output of `arch` or `uname -m` command --> - The contents of your
gdk.yml(if any) - Ruby version:
<!-- output of `ruby --version` command --> - GDK version:
<!-- output of `git rev-parse --short HEAD` command -->
Edited by Mohga Gamea