Mac mini苹果自研M1电脑安装cocoapods问题

  其他Homebrew、Ruby、Gem源更换、cocoapods安装的时候都是比较顺利的,但是就是在pod install 的时候出现了如下错误:

Analyzing dependencies

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

``
/usr/local/bin/pod install
``

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

``
   CocoaPods : 1.10.2
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
    RubyGems : 3.2.24
        Host : macOS 11.1 (20C69)
       Xcode : 12.5.1 (12E507)
         Git : git version 2.30.1 (Apple Git-130)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/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

``ruby
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
#source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'
  target 'XXXXX' do


    pod 'AFNetworking'
    pod 'SDWebImage'
    pod 'FMDB'
    pod 'Masonry'
    pod 'MJRefresh'
    pod 'YYWebImage'#, '~> 1.0.5'

end
``

### Error

``
LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi.rb:5:in `rescue in '
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi.rb:2:in `'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.14.0/lib/ethon.rb:3:in `'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/sources_manager.rb:74:in `cdn_url?'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/analyzer.rb:177:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/analyzer.rb:177:in `sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:414:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/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.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.2/bin/pod:55:in `'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `
' `` ――― TEMPLATE END ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― [!] Oh no, an error occurred. Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+missing+compatible+arch+in+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle&type=Issues If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md Don't forget to anonymize any private data! Looking for related issues on cocoapods/cocoapods... - I can not install pod files. https://github.com/CocoaPods/CocoaPods/issues/10718 [closed] [12 comments] 2 weeks ago - pod install: [!] Oh no, an error occurred. https://github.com/CocoaPods/CocoaPods/issues/5233 [closed] [12 comments] 2 weeks ago

也是顺着其他开发者提交的issue找到了解决方法:isuue�,但是我按其所说的解决却不起作用,因为它一直卡在arch -x86_64 pod install这个命令,因为我添加了清华源(https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
期间我按了好多次ctrl + c(不下20次),但咱又不是那种轻易认输的人,不解决能怎么办,但是看着那进度条从快到慢到半天不动,速度从2.x M/s到几十k/s,然后不动,那种心情。host也做了指向,安装的时候也去监听了网络,都没有问题,就是在安装的时候死慢,最后

命令:

$: Install ffi
$: sudo arch -x86_64 gem install ffi
$: arch -x86_64 pod install

总结:

大家在安装的时候可直接使用自己的流量开热点安装,一切都会顺利很多,包括homebrew安装,就是耗电流量,1~2个G吧。

你可能感兴趣的:(Mac mini苹果自研M1电脑安装cocoapods问题)