【问题标题】:Trying to setup ReactNative project but getting hard time to install CocoaPods尝试设置 ReactNative 项目但很难安装 CocoaPods
【发布时间】:2019-11-15 18:18:03
【问题描述】:

当我尝试使用此 npx react-native init ProjectName 命令并出现以下错误时,无法安装 Cocoapods。 (MacOS Mojave 10.14.4)

⠙ Installing CocoaPods dependencies (this may take a few minutes)/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:241:in `bin_path': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)
    from /usr/local/bin/pod:22:in `<main>'
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./AwesomeProject/ios && pod install".
CocoaPods documentation: https://cocoapods.org/

请帮助了解正在发生的事情以及我们如何解决此问题。

【问题讨论】:

  • 错误消息为您提供了应遵循的具体步骤。我假设您阅读了错误消息并按照它给您的说明进行操作,因为如果不尝试就先在这里询问会很愚蠢。结果如何?
  • 你的 mac 上安装了 cocoapods 吗?

标签: ruby xcode react-native cocoapods


【解决方案1】:

感谢您的回复,但事实证明我的 macOS ruby​​/gems 没有更新。我更新了所有必需的东西并按照相同的步骤现在它工作正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-02-24
    • 1970-01-01
    • 2021-05-30
    • 1970-01-01
    • 2020-01-15
    • 2023-02-04
    • 2020-10-31
    相关资源
    最近更新 更多