首页 > 解决方案 > 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

任何帮助,将不胜感激!谢谢

标签: swiftpodfile

解决方案


感谢@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

推荐阅读