PG::GroupingError: ERROR: column “events.id” must appear in the GROUP BY clause or be used in an aggregate function

Event
  .order(:popularity)
  .joins(:keywords)
  .group('events.id') # <======
  .where(keywords: { category: 'taxonomy' })
  .group('keywords.name')