Unicorn with Ruby 2.4.1 causing weird crash

喜欢而已 提交于 2019-12-05 06:00:03

MacOS High Sierra changed the behaviour of the fork syscall such that calls to Objective-C APIs in forked processes are treated as errors.

When using Ruby on macOS High Sierra, this is what is used By Ruby. The same issue also affects Puma and other servers using a multi-process model and is thus not strictly a Unicorn (or Puma) issue, but one of Ruby.

The issue was discussed on the Unicorn mailing list and on a Puma issue.

If you need to stick to your old Ruby version for any reason, as a workaround, you can add the following environment variable before starting the Ruby process:

OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

Preferably, you should update to Ruby 2.4.4 or higher (including 2.5 and 2.6). These versions include the fix for this issue in Ruby itself and you don't need to set the environment variable anymore.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!