Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Not work on macOS Mojave: may have been in progress in another thread when fork() was called. #13

Open
fifiteen82726 opened this issue Oct 5, 2018 · 24 comments

Comments

@fifiteen82726
Copy link

forecast = ForecastIO.forecast(37.8267, -122.423)
objc[1684]: +[__NSPlaceholderDictionary initialize] may have been in progress in another thread when fork() was called.
objc[1684]: +[__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.
@enciie
Copy link

enciie commented Oct 24, 2018

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

@swaathi
Copy link

swaathi commented Dec 6, 2018

This fix doesn't work on Mojave. It does the trick on High Sierra though.

@ghost
Copy link

ghost commented Feb 12, 2019

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

run this in terminal

@fblupi
Copy link

fblupi commented Apr 30, 2019

Same problem here. Even adding the env variable above

@sourabharsh
Copy link

It worked

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

run this in terminal

It worked for me on Mojave. thanks a lot!

@reekoong
Copy link

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

Worked for me

@marc-wilson
Copy link

Running

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

does not work on Mojave

@marc-wilson
Copy link

Not to revert my previous comment, but I actually did get the export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES environment variable to work. The problem was that I was running the command in the terminal. It won't work there.

In my case, I use PyCharm with a virtual environment. After adding the environment variable directly in my build/debug configuration under environment variables, it worked like a charm:

image

I'm not sure if this is something that's specific to my setup, but doing it this way worked for me.

@coisnepe
Copy link

Doesn't seem to work in Catalina...

@jakubmuransky
Copy link

Doesn't seem to work in Catalina...

Same here, stop working on catalina, stuck on Gathering Facts

@gbudiman
Copy link

gbudiman commented Dec 3, 2019

FWIW, I landed on this page while googling the exact same error message caused by different gem (google-cloud-ruby). I downgraded ruby from 2.6.5 to 2.6.3 and the error went away. I'm on Catalina. Take this with a bucketload of salt though.

@benkruger-neyborly
Copy link

Super stuck with this with Catalina :(

@Arpanbhalla
Copy link

Stuck with Catalina too

@simonc
Copy link

simonc commented Dec 5, 2019

Hi. I had a similar issue after upgrading some brew packages. I couldn't run puma or rspec and was getting this error.

I destroyed my installed rubies and gems and recompiled Ruby. I'm not getting the error anymore.

Hope it helps some of you ❤️

@jatin-ch
Copy link

jatin-ch commented Dec 9, 2019

worked for me on Mojave

$ nano .bash_profile
Add the following line to the end of the file:

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

Save, exit, close terminal and re-open the terminal.

https://stackoverflow.com/questions/50168647/multiprocessing-causes-python-to-crash-and-gives-an-error-may-have-been-in-progr/52230415

@danielrg
Copy link

Try running this way:
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES rails s

@dennyf
Copy link

dennyf commented Dec 12, 2019

Same issue here after upgrading to Catalina.

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
did not work for me.

I was experiencing the issue with an old project running Ruby 2.4.4 (it was not happening with a new project that I created using ruby 2.6.5).
@simonc advice worked for me - I reinstalled ruby 2.4.4 and all the gems in my gemset. For some reason though, reinstalling the gems by deleting them and running bundle install did not work for me. However after I ran bundle update , the issue got resolved.

@noahleal
Copy link

I had this issue today after a fresh install of Catalina. In the end it took upgrading command line tools and restarting my computer to fix it! ✨

@noahleal
Copy link

Well, that only worked for a few days actually. Now I am getting the same error

@mcdave029
Copy link

  • MacOS Catalina
  • asdf version manager
  • zsh

Works for me https://stackoverflow.com/a/53404317 turns out I just need to put OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES above my version manager in .zshrc

@benkruger-neyborly
Copy link

To fix the issue

rvm implode
\curl -sSL https://get.rvm.io | bash
rvm install 2.4.9

@tlkiong
Copy link

tlkiong commented Jan 16, 2020

Just happened to me on Ruby 2.6.5.
Nothing solves it.

This issue is honestly ridiculous

@mozulevskyi
Copy link

mozulevskyi commented Feb 1, 2020

Worked for me on Catalina 👍 Thanks a lot.
vim .bash_profile, and add this line before the last one.
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

@IlyaUmanets
Copy link

Try this one
export DISABLE_SPRING=true
If solutions above don't work for you

colinpetruno added a commit to colinpetruno/portunus that referenced this issue Mar 26, 2020
I did a fresh install with the latest to test run installation and
ran into a few things to add here.

I noticed a bug with Postgres and Spring it seems. I believe the
error is unrelated to Portunus but will continue to research further.
For now I added the solution I found here.
darkskyapp/forecast-ruby#13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests