在 M1 Mac 上设置 React Native 项目时安装 CocoaPod 依赖项时出错

问题描述 投票:0回答:1

我尝试过 sudo gem install -n /opt/homebrew/opt/[email protected]/bin ffi cocoapods 和 brew install cocoapods 但无济于事。

任何帮助将不胜感激。

以下是我的错误:

`
✖ Installing CocoaPods dependencies (this may take a few minutes)
error bundler: failed to load command: pod (/Users/cadyli/Desktop/software projects/ecoexplorer/vendor/bundle/ruby/3.2.0/bin/pod)
/Users/ana/Desktop/software projects/ecoexplorer/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.0/lib/active_support/core_ext/array/conversions.rb:108:in `<class:Array>': undefined method `deprecator' for ActiveSupport:Module (NoMethodError)

  deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
                                                          ^^^^^^^^^^^
Did you mean?  deprecate_constant
    from /Users/ana/Desktop/software projects/ecoexplorer/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.0/lib/active_support/core_ext/array/conversions.rb:8:in `<top (required)>'
    from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
    from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
    from /Users/ana/Desktop/software projects/ecoexplorer/vendor/bundle/ruby/3.2.0/gems/cocoapods-1.13.0/lib/cocoapods.rb:9:in `<top (required)>'
    from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
    from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
    from /Users/ana/Desktop/software projects/ecoexplorer/vendor/bundle/ruby/3.2.0/gems/cocoapods-1.13.0/bin/pod:36:in `<top (required)>'
    from /Users/ana/Desktop/software projects/ecoexplorer/vendor/bundle/ruby/3.2.0/bin/pod:25:in `load'
    from /Users/ana/Desktop/software projects/ecoexplorer/vendor/bundle/ruby/3.2.0/bin/pod:25:in `<top (required)>'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/cli/exec.rb:58:in `load'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/cli/exec.rb:58:in `kernel_load'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/cli/exec.rb:23:in `run'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:492:in `exec'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:28:in `start'
    from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/exe/bundle:37:in `block in <top (required)>'
    from /opt/homebrew/lib/ruby/site_ruby/3.2.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/exe/bundle:29:in `<top (required)>'
    from /opt/homebrew/opt/ruby/bin/bundle:25:in `load'
    from /opt/homebrew/opt/ruby/bin/bundle:25:in `<main>'`

我尝试使用 sudo gem uninstall 将 activesupport 降级到旧版本,然后重新安装,并使用brew 安装所有内容。

react-native rubygems cocoapods
1个回答
0
投票

卸载您当前的主动支持...

sudo gem uninstall activesupport    

然后安装最后一个稳定版本...

sudo gem install activesupport -v 7.0.8    

然后重新安装你的cocoapods!

gem install cocoapods
© www.soinside.com 2019 - 2024. All rights reserved.