This guide explains how to use async-safe to detect thread safety violations in your Ruby code.
async-safe