【问题标题】:Bundler could not find compatible versions for gem "activesupport"Bundler 找不到 gem “activesupport” 的兼容版本
【发布时间】:2013-03-13 21:42:29
【问题描述】:

我迁移到 3.2.13 版本的 rails 并收到此错误,我该如何解决?

Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
  In snapshot (Gemfile.lock):
    activesupport (3.2.12)

  In Gemfile:
    rails (= 3.2.13) ruby depends on
      activesupport (= 3.2.13) ruby

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

编辑

sinatra (1.3.6)
  rack (~> 1.4)
  rack-protection (~> 1.3)
  tilt (~> 1.3, >= 1.3.3)

【问题讨论】:

  • 您是否通过运行gem update rails对其进行了更新?
  • 你能发布你的 Gemfile 吗?里面有没有锁定版本的宝石?
  • 你试过bundle update吗?
  • 我也安装了 rails 3.2.13 版。我尝试了捆绑更新,它似乎没有帮助。我已经附加了在 Gemfile.lock 文件中看到的 sinatra 依赖项。我只是不需要对它有任何直接依赖,但捆绑器仍然希望它存在。

标签: ruby-on-rails ruby-on-rails-3.2 activesupport


【解决方案1】:

对于不小心访问此链接的任何人(当时谷歌首先提供此页面);看看这个帖子Bundler could not find compatible versions for gem, updating Rails app

我的步骤已运行

gem update rails

rm Gemfile.lock

更改我的 Gemfile 以引用我想要的 Rails 版本

gem 'rails', '3.2.13'

终于跑了

bundle install 

我没有按照@PistachioPony 的建议尝试捆绑更新,但这可能会取代删除锁定文件并重建。

【讨论】:

    【解决方案2】:

    带有 Rails 4 的 ActiveAdmin 要求您跟踪 master。来自github页面:

    我们目前正在开发 1.0.0,就依赖项而言,它会移动 我们从 meta_search 到 Ransack 并添加了 Rails 4 支持。你可以得到 跟踪大师支持 Rails 4 和 4.1:

    gem 'activeadmin', github: 'gregbell/active_admin'

    另外,请确保您不要使用 docs on the main page,因为它们对于 rails 4 已经过时。有 updated docs for rails 4 和 master。

    我不确定这个答案会持续多久,所以你应该check github在盲目跟踪大师之前看看事情是否发生了变化。另外,请注意,跟踪大师通常意味着您将在开发更改到来时获得它们。

    【讨论】:

      【解决方案3】:

      如果您将 rails 更改为 3.2.13,那么还要将 gemfile.lock 中的活动支持更改为 3.2.13,然后:

      运行:

      $ 包更新

      关闭你的服务器:

      $ 控制 c

      确保在您的终端中您位于项目文件夹中,然后: 重启你的服务器:

      $ 导轨服务器

      刷新你的浏览器

      【讨论】:

        【解决方案4】:

        像这样:gem 'activeadmin', github: 'gregbell/active_admin' 在 da gemfile 中

        【讨论】:

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