swift - mac 更新到 Catalina 后 Podfile 不会更新,原因:找不到图像
问题描述
我最近将我的 mac 更新为 Catalina,因为当我尝试安装/更新它(Podfile)时,我的一个项目的 Podfile 崩溃了。
Traceback (most recent call last):
20: from /usr/local/bin/pod:23:in `<main>'
19: from /usr/local/bin/pod:23:in `load'
18: from /usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.9.1/bin/pod:36:in `<top (required)>'
17: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
16: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
15: from /usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.9.1/lib/cocoapods.rb:17:in `<top (required)>'
14: from /usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.9.1/lib/cocoapods.rb:75:in `<module:Pod>'
13: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
12: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
11: from /usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.9.1/lib/cocoapods/core_overrides.rb:1:in `<top (required)>'
10: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
9: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
8: from /usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.9.1/lib/cocoapods/sources_manager.rb:5:in `<top (required)>'
7: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
6: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
5: from /usr/local/lib/ruby/gems/2.5.0/gems/typhoeus-1.3.1/lib/typhoeus.rb:1:in `<top (required)>'
4: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
3: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
2: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/digest/sha2.rb:14:in `<top (required)>'
1: from /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': dlopen(/usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/x86_64-darwin17/digest/sha2.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError)
Referenced from: /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/x86_64-darwin17/digest/sha2.bundle
Reason: image not found - /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/x86_64-darwin17/digest/sha2.bundle
我从这条回溯消息中了解到,其中一个文件的引用不正确,但我不确定如何解决这个问题。我尝试将我的 Podfile 归结为基本要素,但错误仍然存在。这是 Pod 文件:
# Uncomment the next line to define a global platform for your project
platform :ios, '13.2'
target 'ShoeSwiperMenus' do
end
我尝试按照这个逐步的过程,认为它可能会有所帮助,但它没有。
运行时sudo gem install cocoapods
,我收到以下错误:
ERROR: Loading command: install (LoadError)
dlopen(/usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/x86_64-darwin17/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/x86_64-darwin17/openssl.bundle
Reason: image not found - /usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/x86_64-darwin17/openssl.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
任何帮助,将不胜感激!谢谢
解决方案
感谢@matt,我很快解决了这个问题。正如他所指出的,我的红宝石坏了。这些是我为解决此问题而采取的步骤:
安装 Ruby 版本管理器 rvm:curl -L https://get.rvm.io | bash -s stable
安装最新版本的 Ruby:rvm install ruby-[version]
在我的例子中是:rvm install ruby-2.7
然后:rvm use ruby-2.7
和:
sudo gem uninstall cocoapods
sudo gem install -n /usr/local/bin cocoapods
推荐阅读
- django - django 社交登录 allauth 的问题:如果电子邮件存在,则重定向到 http://127.0.0.1:8000/accounts/social/signup/#
- java - 如何过滤带有语音到文本的recyclerview项目
- kotlin - 自定义 AlertDialog 的圆角
- java - 如何修复 lang is undefined 问题 graphql 服务器错误?
- c++ - getline 函数中的缓冲区清理
- instagram - SparkAR:进行直播时未出现已发布的 Instagram 效果
- java - 将 setContentView 与布局资源和视图一起使用的区别
- linux - gsed 无法识别 SHIFT_JIS 字符
- google-cloud-spanner - 如何在扳手中使用占位符
- java - Java 11 中带有自定义图标的 JFrame