为啥我在 Xcode 中的 pod init 期间收到加载错误?

Posted

技术标签:

【中文标题】为啥我在 Xcode 中的 pod init 期间收到加载错误?【英文标题】:Why am I getting a load error during pod init in Xcode?为什么我在 Xcode 中的 pod init 期间收到加载错误? 【发布时间】:2020-03-11 19:37:13 【问题描述】:

我正在使用 Xcode 构建一个社交媒体应用。运行 pod init 后,我​​得到了错误-

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require': 无法加载此类文件-- 并发/执行程序/cached_thread_pool (LoadError)`

我已经尝试运行 sudo gem install concurrent executor cached thread pool 得到这个结果

**Building native extensions. This could take a while...
ERROR:  Error installing concurrent:
    ERROR: Failed to build gem native extension.
    current directory: /Library/Ruby/Gems/2.6.0/gems/concurrent-0.2.2/ext/concurrent/futures
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200311-6507-4x4g6z.rb extconf.rb
creating Makefile
current directory: /Library/Ruby/Gems/2.6.0/gems/concurrent-0.2.2/ext/concurrent/futures
make "DESTDIR=" clean
current directory: /Library/Ruby/Gems/2.6.0/gems/concurrent-0.2.2/ext/concurrent/futures
make "DESTDIR="
compiling futures.c
In file included from futures.c:10:
/Users/davidstreet/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/backward/rubysig.h:14:2: warning: rubysig.h is obsolete [-W#warnings]
#warning rubysig.h is obsolete
 ^
futures.c:11:10: fatal error: 'intern.h' file not found
#include "intern.h"
         ^~~~~~~~~~
1 warning and 1 error generated.
make: *** [futures.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/concurrent-0.2.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/concurrent-0.2.2/gem_make.out
Successfully installed executor-0.0.1
Parsing documentation for executor-0.0.1
Done installing documentation for executor after 0 seconds
Successfully installed cached-0.2
Parsing documentation for cached-0.2
Done installing documentation for cached after 0 seconds
Successfully installed thread-0.2.2
Parsing documentation for thread-0.2.2
Done installing documentation for thread after 0 seconds
Successfully installed pool-0.0.1
Parsing documentation for pool-0.0.1
Done installing documentation for pool after 0 seconds
4 gems installed
davidstreet@Davids-MacBook-Pro lnc.xcodeproj %**

我是应用程序开发的新手,所以任何帮助都会很棒。谁能告诉我这是否是一个我可以下载预发行版并解决的错误?

【问题讨论】:

【参考方案1】:

使用这些命令

gem install thread

gem install pool 

希望对你有用

【讨论】:

谢谢你的建议,我试过了,没有成功。还是得到了。 1:来自/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require':无法加载此类文件- - 并发/执行程序/cached_thread_pool (LoadError)

以上是关于为啥我在 Xcode 中的 pod init 期间收到加载错误?的主要内容,如果未能解决你的问题,请参考以下文章

Swift - 为啥在 AFHTTPSessionManager 中需要 init(coder)?

SwiftUI @State 数组未更新在 init() 期间附加的值

为啥在 Objective-C 中执行 alloc 和 init 在单独的语句中会导致对象根据 Xcode 静态分析器被释放?

想要在 Xcode 中的 UI 测试期间在测试运行后停止调试控制台清除

Xcode 9 Beta 5 中的“ARConfiguration() – init() 不可用”错误

为啥 Xcode 不执行 func tableView 中的代码?