gpt4 book ai didi

ruby-on-rails - rails : may have been in progress in another thread when fork() was called

转载 作者:行者123 更新时间:2023-12-02 05:16:30 25 4
gpt4 key购买 nike

升级到OS10.14后,调用Httparty时出现此错误

    response = HTTParty.get('http://api.stackexchange.com/2.2/questions?site=stackoverflow')
objc[4182]: +[__NSPlaceholderDictionary initialize] may have been in progress in another thread when fork() was called.
objc[4182]: +[__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.

我已经尝试过了在启动 Rails 控制台之前导出 OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

但是没有成功。

最佳答案

在 Rails 控制台之前运行解决方法命令是不够的。

以下解决方案对我有用(遵循此说明):

如果遇到此错误,您可以将以下代码添加到位于主目录中的 .bash_profile 中来解决该问题。

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
  1. 打开终端
  2. 输入 cd ~ 导航到您的主目录
  3. 在编辑器中打开 .bash_profile(VS Code 为 code,Atom 为atom、vim、nano 等)纳米.bash_profile
  4. 将导出 OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES 复制并粘贴到您的文件中(确保它位于文件底部的 RVM 部分上方!)

* 这很重要*就我而言,进入 .bash_profile 是这样的:

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

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

保存文件并退出所有编辑器和终端 session 。重新打开编辑器,现在一切都应该正常工作。

我在此链接 Kody Clemens Personal Blog 找到了此解决方案

关于ruby-on-rails - rails : may have been in progress in another thread when fork() was called,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52671926/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com