两天前升级到 Mojave 。 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
卸载了一些 gems 并尝试但同样的错误。这两天快死了而且我不仅仅是升级后面临这个问题的人。
最佳答案
把这个export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
在您的 ~/.bash_profile
如果您使用的是 oh-my-zsh,请编辑 ~/.zshrc
并把这个export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
在文件的开头
然后重新加载您的 zsh 配置 $ source ~/.zshrc
关于ruby-on-rails - 升级到 macOS Mojave,现在在 rails 控制台中出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52941426/