【问题标题】:bundle exec pod install -> Failed to find known source with the URL "trunk"bundle exec pod install -> 找不到 URL 为“trunk”的已知源
【发布时间】:2021-01-10 09:33:14
【问题描述】:

我正在遵循一些关于 Xcode 存储库的说明。

$ bundle exec pod install
Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (1.9.3) is higher than the version of the \
current executable (1.6.1). Incompatibility issues may arise.

我认为这会导致错误:

 Failed to find known source with the URL "trunk"

当我检查pods 的版本时,我得到:

$ pod --version
1.10.0

我的假设(但我可能是错的)是我需要运行命令以运行较新版本的 pod,或者我需要在其他位置安装较新版本。

添加信息 (根据评论的要求)

$ gem list pod

*** LOCAL GEMS ***

cocoapods (1.10.1, 1.10.0)
cocoapods-core (1.10.1, 1.10.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.4.0)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-trunk (1.5.0)
cocoapods-try (1.2.0)


$ grep -i pod Gemfile.lock
    cocoapods (1.6.1)
      cocoapods-core (= 1.6.1)
      cocoapods-deintegrate (>= 1.0.2, < 2.0)
      cocoapods-downloader (>= 1.2.2, < 2.0)
      cocoapods-plugins (>= 1.0.0, < 2.0)
      cocoapods-search (>= 1.0.0, < 2.0)
      cocoapods-stats (>= 1.0.0, < 2.0)
      cocoapods-trunk (>= 1.3.1, < 2.0)
      cocoapods-try (>= 1.1.0, < 2.0)
    cocoapods-core (1.6.1)
    cocoapods-deintegrate (1.0.4)
    cocoapods-downloader (1.2.2)
    cocoapods-plugins (1.0.0)
    cocoapods-search (1.0.0)
    cocoapods-stats (1.1.0)
    cocoapods-trunk (1.3.1)
    cocoapods-try (1.1.0)
  cocoapods

【问题讨论】:

  • 你能gem list pod 给我们输出吗?另外,你能grep -i pod Gemfile.lock 吗?
  • 将两者都添加到问题中。
  • 您可以试试bundle update cocoapods 看看是否有帮助?您的捆绑包具有当前 gemset 的旧版本。

标签: ruby rubygems


【解决方案1】:

我已经多次遇到这个问题,但不知道为什么。要修复,我在项目目录中运行以下终端命令:

sudo gem install cocoapods-deintegrate cocoapods-clean(仅当您没有安装 cocoapods-deintegratecocoapods-clean 时)

pod deintegrate

pod clean

pod setup

pod install

据我了解,这将完全清除并重新安装 pod 文件。同样,我不确定是什么导致问题开始,但这对我有用。

【讨论】:

  • 请记住,如果您这样做,则相当于运行 pod update,因为您的所有 pod 都将更新到最新版本,除非您已锁定 Podfile 中的版本信息。这可能会在您的项目中安装较新版本的 pod 库时产生意想不到的后果。
  • 上述步骤对我没有帮助,仍然出现同样的错误,必须切换到 ruby​​ 2.7(使用 rbenv)然后安装 ruby​​ 2.7 支持的最新版本的 cocoapods。
猜你喜欢
  • 1970-01-01
  • 2012-12-21
  • 2021-12-21
  • 2019-02-08
  • 1970-01-01
  • 1970-01-01
  • 2015-01-08
  • 1970-01-01
相关资源
最近更新 更多