Description
I suddenly starting running into an issue today on my Rails project where all commands I run that use spring
as a preloader, such as rspec
or rake
fail due to an error similar to this:
objc[8689]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[8689]: +[__NSCFConstantString 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.
This happened right after I upgraded all my Homebrew packages on my Mac machine (Mac OS 10.15.1). I can verify that I was not running into this issue on my machine before I upgraded my Homebrew packages, which rules out the issue being due to an application code change. I can also note that I have deduced this to be a Spring issue because I don't run into this error when I run these commands with Spring disabled, via the DISABLE_SPRING=1
variable.
I'm guessing that one of the upgrades from one of my Homebrew packages is serving as a catalyist for this bug to manifest. I'm unsure of how to track this down myself. Here's my list of Homebrew packages, maybe it'll be useful.
In the meanwhile, I'm using an environment variable workaround I've commonly seen in Google searches, such as from this post, to disable this MacOS check.