Rails 4 的 ActiveAdmin:Bundler 找不到 gem "rails" 的兼容版本

ActiveAdmin with Rails 4: Bundler could not find compatible versions for gem "rails"

我是 rails 的新手,正在使用 4.2.4 版构建我的第一个 Web 应用程序。

我正在尝试使用

安装 activeadmin gem
gem 'activeadmin', '~> 0.6.6'

但是,当我 运行 捆绑安装时,我收到一条错误消息:

Bundler could not find compatible versions for gem "rails":
  In snapshot (Gemfile.lock):
    rails (= 4.2.4)

  In Gemfile:
    activeadmin (~> 0.6.6) ruby depends on
      rails (< 4, >= 3.0.0) ruby

    rails (= 4.2.4) ruby

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

这是否暗示我需要降低 rails 的一个版本才能使 gem 正常工作,或者我可以保留 4.2.4 并使用建议的捆绑包更新方法而不引起任何问题我的应用和其他 gems?

有问题吗?

您的 Gemfile 指定的 activeadmin 版本不支持 Rails 4. 来自 the readme:

We're currently working on 1.0.0, which as far as dependencies, moves us from meta_search to Ransack and adds Rails 4 & 5 support.

You can get it by tracking master:

gem 'activeadmin', github: 'activeadmin'

Or you can using rubygems:

gem 'activeadmin', '~> 1.0.0.pre2'

如图所示更改 Gemfile,然后 运行 bundle install