Writing Monkey Patch tips@JuanitoFatas Check loaded gem version against a version, use Gem::Version Gem.loaded_specs["activerecord"].version >= Gem::Version.new("7.0.5")