[Fixes#52124413] Modified query to check scheduled_time of first trip_part.
Gemfile update.