【问题标题】:Bundler could not find compatible versions for gem "activesupport": When i try to update cocoapods versionBundler 找不到 gem“activesupport”的兼容版本:当我尝试更新 cocoapods 版本时
【发布时间】:2020-07-13 11:20:35
【问题描述】:

Bundler 找不到 gem "activesupport" 的兼容版本:

  In Gemfile:
    cocoapods (~> 1.9.3) was resolved to 1.9.3, which depends on
      activesupport (>= 4.0.2, < 5)

    ion_develop_rails (~> 7.4) was resolved to 7.6.0, which depends on
      activesupport (>= 5.0)

当我尝试运行捆绑更新时出现上述错误。在此之前,cocoapods 版本是 1.0.1,我已将其更新为 1.9.3,并尝试“捆绑更新”并收到此错误。

我尝试解决此问题的步骤。

  1. 我删除了 Gemfile.lock 和 bundle install 中的所有 cocoapods 信息,但没有成功。
  2. 我还尝试更新 rails gem,然后更新包,但没有成功。

请帮我解决这个问题。提前致谢。

【问题讨论】:

  • ion_develop_rails 确实给您带来了我认为的问题。它需要更新的主动支持。所以也许你应该坚持ion_develop_rails 到版本7.4,没有~&gt; ...但我会完全删除 Gemfile.lock 然后`捆绑安装并检查它是否适合你。如果由于某种原因您仍然需要旧的 Gemfile.lock,您可以将其复制到另一个地方,以免丢失最后一个工作堆栈。
  • @sonic 你的意思是说我应该完全删除 Gemfile.lock 然后将 ion_develop_rails 版本修复为 '7.4' 然后运行 ​​'bundle install' 对吗?
  • 首先我会删除它。然后bundle install,如果它不能自行解决,那么我会坚持使用版本7.4,然后再使用bundle install。如果它与您的其他 gem 的 1.0.1 版本一起使用,我只假设它使用以前版本的 activerecord。
  • @sonic 我曾尝试删除 Gemfile.lock 和“捆绑安装”。它没有这样工作。我现在试试其他步骤看看。
  • 所以也许版本 1.0.1 甚至没有使用 activesupport...

标签: ruby-on-rails ruby


【解决方案1】:

我刚刚找到了解决上述问题的方法。而不是在 Gemfile 中添加 cocoapods,如果我在 gemspec 中添加它作为我想要的版本的依赖项将解决问题。 我已经像这样在 gemspec 中添加了 cocoapods 依赖项 spec.add_dependency 'cocoapods', '~> 1.9'

@索尼克。感谢您的投入。

【讨论】:

    猜你喜欢
    • 2013-03-13
    • 1970-01-01
    • 2011-10-31
    • 1970-01-01
    • 2017-07-17
    • 2018-02-09
    • 2014-05-26
    • 2014-03-14
    • 2019-05-07
    相关资源
    最近更新 更多