【问题标题】:Why is my React Native Pod Install Erroring?为什么我的 React Native Pod 安装出错?
【发布时间】:2022-11-11 10:41:55
【问题描述】:

尝试在新的 React Native 项目中运行 pod install 并收到此错误。 Ruby 是用 brew 安装的

我已经安装了 chruby 和 ruby​​-install,然后我用它们来安装 ruby​​-2.7.5 cocopods、ffi 和 bundler。尝试安装 bundler 时出现此错误:

warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
fatal: not a git repository (or any of the parent directories): .git
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes/hermes-engine.podspec`
[!] Couldn't determine repo type for URL: `https://cdn.cocoapods.org/`: Permission bits for '/Users/macbook/.netrc' should be 0600, but are 644

【问题讨论】:

    标签: ruby react-native chruby ruby-install


    【解决方案1】:

    得到与以下相同的错误:

    ✔ Downloading template
    ✔ Copying template
    ✔ Processing template
    ℹ Installing dependencies
    ✔ CocoaPods (https://cocoapods.org/) is not installed. CocoaPods is necessary for the iOS project to run correctly. Do you want to install it? › Yes, with gem (may require sudo)
    ✔ Installing CocoaPods
    ✔ Installing Bundler
    ✖ Installing CocoaPods dependencies (this may take a few minutes)
    error warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
    
    ✖ Installing CocoaPods dependencies (this may take a few minutes)
    error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
    
    

    环境:macOS Catalina 10.15.7

    1. 通过gem 安装如下cocoapods。

      rn sudo gem install -n /usr/local/bin cocoapods 密码:

      1. run react-native init myproj时,选择gem再次安装cocoapods。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多