升级到macOS Mojave,现在在rails控制台中出现错误

问题描述 投票:4回答:2

两天前升级到莫哈韦。 Rails服务器正在运行,但是当我尝试运行activerecord的东西时,我收到错误。当我尝试运行“Account.last”或“Account.new”或其他任何东西时,它会把我踢出去并给我以下错误

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

卸载了几个宝石并尝试但同样的错误。这是过去两天杀了我的。而且我不仅是升级后面临这个问题的人。

ruby-on-rails macos fork macos-mojave
2个回答
1
投票

把这个export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES放在你的~/.bash_profile

如果你正在使用oh-my-zsh,请编辑~/.zshrc并将此export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES放在文件的开头

然后重新加载你的zsh配置$ source ~/.zshrc


0
投票

升级到莫哈韦之后,一位同事今天遇到了同样的问题。

问题解决了从unicorn-rails切换到puma服务器。因此,为了继续您的日常工作,您可以将开发/测试中的服务器更改为puma。

这不是永久性解决方案,但有助于找到问题所在的位置并取消阻止开发人员工作流程。

© www.soinside.com 2019 - 2024. All rights reserved.