Pod 安装在 Mac M1 芯片中不起作用

时间:2021-03-30 07:55:37

标签: ruby cocoapods

(base) sameer@Sameers-Air ios % pod installl                    
Traceback (most recent call last):
    16: from /usr/local/bin/pod:23:in `<main>'
    15: from /usr/local/bin/pod:23:in `load'
    14: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:36:in `<top (required)>'
    13: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    12: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    11: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods.rb:9:in `<top (required)>'
    10: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     9: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     8: from /Users/sameer/.gem/gems/activesupport-5.2.5/lib/active_support/core_ext/array/conversions.rb:3:in `<top (required)>'
     7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     5: from /Users/sameer/.gem/gems/activesupport-5.2.5/lib/active_support/xml_mini.rb:5:in `<top (required)>'
     4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     2: from /Library/Ruby/Gems/2.6.0/gems/bigdecimal-3.0.0/lib/bigdecimal.rb:1:in `<top (required)>'
     1: from /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': dlopen(/Library/Ruby/Gems/2.6.0/gems/bigdecimal-3.0.0/lib/bigdecimal.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/bigdecimal-3.0.0/lib/bigdecimal.bundle - /Library/Ruby/Gems/2.6.0/gems/bigdecimal-3.0.0/lib/bigdecimal.bundle (LoadError)

2 个答案:

答案 0 :(得分:0)

我在 M1 Silicon 中安装低于 Ruby 2.7.2 的任何东西时遇到问题。

似乎 cocoapods 只是一个 ruby​​ gem,因此安装 RVM 以安装不同的 Ruby 版本应该适合您。

\curl -sSL https://get.rvm.io | bash -s stable
rvm install ruby-2.7.2
gem install cocoapods

答案 1 :(得分:0)

运行这个:

arch -x86_64 pod install