Fixing objc_initializeAfterForkError the right way
This is a technical blog post, about how we investigated and solved an error occurring when running Rails tests.
Sometimes, when running a Rails command on macOS, we can encounter a error, promptly followed by a crash:
+[NSCheapMutableString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.