Pod install CocoaPods LoadError: Image not found (M1 MacBook)

Report


What did you do?


run pod install

What did you expect to happen?


Firebase pods installing correctly

What happened instead?


CocoaPods states an LoadError giving out the reason: Image not found
Code Block
LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 9): Library not loaded: @rpath/libffi.7.dylib
Referenced from: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle
Reason: image not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle


CocoaPods Environment


Stack


Code Block
CocoaPods : 1.10.1
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
RubyGems : 3.0.3
Host : macOS 11.2.3 (20D91)
Xcode : 12.4 (12D4e)
Git : git version 2.24.3 (Apple Git-128)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories :


Plugins


Code Block
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-trunk : 1.5.0
cocoapods-try : 1.2.0


Podfile


Code Block ruby
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'CocoapodsTest' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for CocoapodsTest
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
target 'CocoapodsTestTests' do
inherit! :search_paths
# Pods for testing
end
target 'CocoapodsTestUITests' do
# Pods for testing
end
end


Error


Code Block
LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 9): Library not loaded: @rpath/libffi.7.dylib
Referenced from: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle
Reason: image not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle
/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'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi.rb:6:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi.rb:3:in `<top (required)>'
/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'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>'
/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'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/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'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:74:in `cdn_url?'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'



Tried Fixes


I've tried some possible fixes found in this issue page. When running:
Code Block
sudo arch -x86_64 gem install ffi


the output will be:

Code Block
Building native extensions. This could take a while...
Successfully installed ffi-1.15.0
Parsing documentation for ffi-1.15.0
Done installing documentation for ffi after 3 seconds
1 gem installed


When running:
Code Block
sudo gem install ffi


the output will be:

Code Block
Building native extensions. This could take a while...
Successfully installed ffi-1.15.0
Parsing documentation for ffi-1.15.0
Done installing documentation for ffi after 3 seconds
1 gem installed


Note: The terminal is checked as: Open with Rosetta


Tried with the Ruby 2.4.10. with the same result.
I installed 2.4.10 with:
Code Block shell
\curl -sSL https://get.rvm.io | bash -s stable

Code Block shell
CFLAGS="-Wno-error=implicit-function-declaration" rvm install 2.4.10


The FFI is installed:
Code Block shell
ls /usr/local/opt/libffi/lib
libffi.7.dylib libffi.a       libffi.dylib   pkgconfig


still the error is:

Code Block shell
### Stack
   CocoaPods : 1.10.1
        Ruby : ruby 2.4.10p364 (2020-03-31 revision 67879) [-darwin20]
    RubyGems : 3.0.9
        Host : macOS 11.3.1 (20E241)
       Xcode : 12.5 (12E262)
         Git : git version 2.30.1 (Apple Git-130)
Ruby lib dir : /Users/my_username/.rvm/rubies/ruby-2.4.10/lib
Repositories : 
### Plugins
cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0
### Podfile
platform :ios, '14.0'
use_frameworks!
target 'Beacon Proximity' do
  pod 'RxBluetoothKit', '~> 6.0'
end
### Error
LoadError - dlopen(/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 9): Library not loaded: @rpath/libffi.7.dylib
  Referenced from: /Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/ffi-1.15.0/lib/ffi_c.bundle
  Reason: image not found - /Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/ffi-1.15.0/lib/ffi_c.bundle
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/ffi-1.15.0/lib/ffi.rb:6:in `rescue in <top (required)>'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/ffi-1.15.0/lib/ffi.rb:3:in `<top (required)>'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/ethon-0.14.0/lib/ethon.rb:3:in `<top (required)>'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:74:in `cdn_url?'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `map'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `sources'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Users/my_username/.rvm/rubies/ruby-2.4.10/lib/ruby/gems/2.4.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/Users/my_username/.rvm/rubies/ruby-2.4.10/bin/pod:23:in `load'
/Users/my_username/.rvm/rubies/ruby-2.4.10/bin/pod:23:in `<main>'
/Users/my_username/.rvm/gems/ruby-2.4.10/bin/ruby_executable_hooks:22:in `eval'
/Users/my_username/.rvm/gems/ruby-2.4.10/bin/ruby_executable_hooks:22:in `<main>'



up

Pod install CocoaPods LoadError: Image not found (M1 MacBook)
 
 
Q