rails错误Bundler找不到gem gem的兼容版本" spree_backend"

时间:2016-02-27 12:09:04

标签: ruby-on-rails

我想在spree中配置电子邮件设置 我根据本教程https://guides.spreecommerce.com/user/configuring_mail_methods.html

添加了这个gem
  gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings', branch: 'master'

但是运行bundle install会出现以下错误:

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

  In Gemfile:
    spree (~> 3.0.7) was resolved to 3.0.7, which depends on
      spree_backend (= 3.0.7)

    spree_mail_settings was resolved to 2.2.0, which depends on
      spree_backend (~> 3.1.0.beta)

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

运行捆绑更新给了我:

Bundler could not find compatible versions for gem "spree_backend":
  In Gemfile:
    spree_mail_settings was resolved to 2.2.0, which depends on
      spree_backend (~> 3.1.0.beta)

Could not find gem 'spree_backend (~> 3.1.0.beta)', which is required by gem
'spree_mail_settings', in any of the sources.

在我的gemfile中我有:

gem 'spree', '~> 3.0.7'
gem 'spree_gateway', '~> 3.0.0'
gem 'spree_auth_devise', '~> 3.0.0'
gem 'spree_i18n', git: 'git://github.com/spree/spree_i18n.git', branch: '3-0-stable'
gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings', branch: 'master'

我试着像这样写gem 'spree', '~> 3.1.0',但它没有工作

2 个答案:

答案 0 :(得分:0)

〜> 3.0.7相当于> = 3.0.7和< 3.1

我不会试图分开什么是和不兼容,而是像以下那样安装它:

gem 'spree'
gem 'spree_gateway'
gem 'spree_auth_devise'
gem 'spree_i18n', git: 'git://github.com/spree/spree_i18n.git', branch: '3-    0-stable'
gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings', branch: 'master'

然后我将捆绑安装和捆绑更新。然后我检查gemfile.lock并查看gems版本自己的内容。希望它能够妥善解决。

答案 1 :(得分:0)

删除Gemfile.lock文件,然后运行bundle installbundle update。我不能保证这个选项应该可行,只需尝试一下。