Upgraded to Mojave two days ago. Rails server is running but when I try to run activerecord stuff, I get error. When I try to run "Account.last" or "Account.new" or anything, it kicks me out and giving me following error
objc[38551]: +[__NSPlaceholderDictionary initialize] may have been in
progress in another thread when fork() was called.
objc[38551]: +[__NSPlaceholderDictionary 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.
Ruby 2.3.4
Rails 5.1.6
Uninstalled few gems and tried but same error. It's killing me for last two days. And I am not only one facing this issue after upgrading.
put this export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
in your ~/.bash_profile
if you're using oh-my-zsh, edit ~/.zshrc
and put this
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
at the beginning of file
and then reload your zsh config $ source ~/.zshrc
Are you using Postgres?
I started getting this error when running puma in cluster mode (specifying workers) after moving to a new computer (running macOS Catalina). The issue seemed to be a result of my psql
version. OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES bundle exec rails s puma
did work but I was not satisfied since everything was working without that env variable.
I moved my psql version from 12 to 9.5 and rebuilt the pg gem and it fixed the issue without the env variable:
brew uninstall postgres
brew install [email protected]
brew link [email protected] --force
gem uninstall pg
bundle install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With