A gemspec file in a gem repository is often helpful as it defines the required_ruby_version, but as you've noticed, not all gems installed on your system will expose that directly in your local copy. This can make the process time-consuming and error-prone.
A more efficient and reliable way to handle this is to use RailsUp. It is a tool designed specifically to check gems compatibility for free. One of RailsUp's standout features is its ability to analyze your application and generate a detailed compatibility report for your gems, showing which Ruby versions are supported.
Instead of manually inspecting gemspec files or cross-referencing versions on GitHub, RailsUp allows you to focus on the upgrade process itself.
You can try out the tool here: RailsUp
Feel free to share your feedback on the tool.