Could not find compatible versions
Because active_record_distinct_on >= 1.5.0 depends on activerecord >= 5.2, < 7.1
and rails >= 7.1.0 depends on activerecord = 7.1.0,
active_record_distinct_on >= 1.5.0 is incompatible with rails >= 7.1.0.
So, because Gemfile depends on rails ~> 7.1
and Gemfile depends on active_record_distinct_on ~> 1.5.0,
version solving has failed.
See: https://github.com/alecdotninja/active_record_distinct_on/blob/9e0f0a6ead19d96caa0e2ab08248b15f724deb60/active_record_distinct_on.gemspec#L20