Failed to compile

Hey guys I am new to ruby motion and wanna build my first app OSX and got type of errors
could you help how can I fix this
`
Build ./build/MacOSX-10.15-Development

Compile ./app/app_delegate.rb

Compile ./app/menu.rb

objc[63743]: +[NSPlaceholderMutableString initialize] may have been in progress in another thread when fork() was called.

objc[63743]: +[NSPlaceholderMutableString 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.

objc[63744]: +[NSPlaceholderMutableString initialize] may have been in progress in another thread when fork() was called.

objc[63744]: +[NSPlaceholderMutableString 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.

ERROR! File ‘./app/menu.rb’ failed to compile`

during this errors it suggested and I set the env RM_BYPASS_DOCTOR=1

could you help me?

Catalina gets a bit picky - have you also added

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

to your shell?

Hi!

I’ve failed to compile my first RubyMotion app, too:

+[NSPlaceholderMutableString initialize] may have been in progress in another thread when fork() was called.

Adding

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

as indicated by @red_menace in it’s post from Jun’20 helped me, too – but why?

Any explanation or resources available to help my as a RubyMotion newbie understanding what’s going on here?

Cheers,
Michael

A common Unix technique is/was to implement concurrency by forking instead of spawning threads. The RubyMotion compiler also uses this technique (it has been around for a while). There were security updates made in macOS 10.13 High Sierra and later that changed how fork() behaves.

Before macOS 10.13, the Objective-C runtime did not support use between fork() and exec() in the child process of a multithreaded parent process. If you called a disallowed function after forking, it might look like it is working most of the time, but there was always the possibility of a catastrophic failure (forking has always been dangerous). Now the runtime supports use between fork() and exec(), but there are rules that Apple has started enforcing, for example with +initialize. Break the rules, and Apple makes the application crash immediately.

OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES is a workaround that restores the previous behavior (the compiler’s thread usage is being updated).

…many thanks for elaborating this for me!

But this means I still have to permanently add this workaround for using RubyMotion? macOS 10.13 has been a while and I thought RubyMotion being a commercial product under active development?

Regards.
Michael

It may not be all that visible, but it is under active development. The toolchain is in the process of being rebranded (DragonRuby) and expanded (Game ToolKit, etc). Part of this expansion also involves uncoupling the various pieces of the toolkit so that they can be updated and used in other products. Apple constantly changes their tools and OSes (even more so now with Apple Silicon), and Ruby and LLVM are also moving targets, so I think it is safe to say they have enough to keep busy.