Reputation: 851
I recently updated my mac to Catalina and since, the Podfile for one of my projects is crashing when I try to install/update it (the 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
What I understand from this traceback message is that the reference for one of the files is not correct but I'm not sure how to fix this. I tried boiling down my Podfile to the essentials but the error still persists. This is the Podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '13.2'
target 'ShoeSwiperMenus' do
end
I tried following this step by step process thinking it could help but it didn't.
When running sudo gem install cocoapods
, I get the following error:
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
Any help would be appreciated! Thank you
Upvotes: 0
Views: 277
Reputation: 851
Thanks to @matt, I solved this pretty quickly. As he pointed out, my ruby was broken. These are the steps I took to solve this:
Install the Ruby Version Manager rvm: curl -L https://get.rvm.io | bash -s stable
Install the latest version of Ruby: rvm install ruby-[version]
In my case this was: rvm install ruby-2.7
Then: rvm use ruby-2.7
And:
sudo gem uninstall cocoapods
sudo gem install -n /usr/local/bin cocoapods
Upvotes: 1