0

我正在尝试将 Rails 更新到 5.0.0.beta1,但出现如下错误:

Bundler could not find compatible versions for gem "minitest":
  In Gemfile:
    rails (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
      activejob (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
activesupport (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends
on minitest (~> 5.1)
    minitest-rails-capybara was resolved to 0.0.1, which depends on
      minitest-rails was resolved to 0.5, which depends on
        minitest (~> 4.0)

没有 gem,包括minitest-rails-capybara,在我的 Gemfile 中明确设置了它的版本。我的应用程序中没有Gemfile.lock文件(我删除了升级分支中的现有文件。)

minitest-rails-capybara是当前 gemset(以及其他 gemset)中的最新版本。为什么会出现此错误?

编辑即使在开始使用新应用程序后,(rails new)如果我将这些行添加到 Gemfile,我也会收到上述错误:

group :test do
  gem 'minitest-spec-rails'
  gem 'minitest-rails-capybara'
end

版本:

  • 红宝石:2.3.0
  • 捆绑器:1.11.2
  • 宝石:2.5.1
4

1 回答 1

0

好吧,我想我在这里有点过头了——这些 gem 至少在 Rubygems.org 上没有兼容 Rails5 的版本。

直接指向 Github 可以解决这个问题:

  gem 'minitest-rails',  git: 'https://github.com/blowmage/minitest-rails', branch: 'rails5'
  gem 'minitest-spec-rails'
  gem 'minitest-rails-capybara', git: 'https://github.com/blowmage/minitest-rails-capybara', branch: 'rails5'
于 2016-01-24T01:19:34.203 回答