Bundler 找不到 gem "rails" 的兼容版本 |在 Gemfile 中:rails (~> 6.1.0) x64-mingw3

Bundler could not find compatible versions for gem "rails" | In Gemfile: rails (~> 6.1.0) x64-mingw3

我正在使用 Spree Commerce 在 Rails 项目上开发一个新的 Ruby,而 运行ning bundle install 我收到以下错误:

Bundler could not find compatible versions for gem "rails":
rails (~> 6.1.0) x64-mingw32

spree (~> 4.1) x64-mingw32 was resolved to 4.2.0.beta, which depends on
  spree_core (= 4.2.0.beta) was resolved to 4.2.0.beta, which depends on
    rails (~> 6.0.0)

我正在关注 Spree Commerce Docs 安装。

我在 Windows 10,使用 Ruby 2.7.2Bundler 2.2.3Rails 6.1.0 然后,我的 Gemfile 包括:

gem 'spree', '~> 4.1'
gem 'spree_auth_devise', '~> 4.2'
gem 'spree_gateway', '~> 3.9'

我尝试删除 spree gems,然后 运行 默认 Gemfile,它成功安装了依赖项,但是当我添加这些 gems 时抛出上述错误。

我已经尝试了以下所有方法,但没有任何效果:

  • 已删除Gemfile.lock
  • bundle update
  • bundle install --full-index
  • 检查环境变量
  • 重新安装了rails项目

狂欢doesn't support Ruby on Rails 6.1 yet。这是为 Spree 4.3 计划的。

因此,您唯一的选择是将 Rails 上的 Ruby 降级为 ~> 6.0.3