Home Articles

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

Asked
Viewed 403 times
0

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

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 Answers

  • 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版本自己的内容 . 希望它能够妥善解决 .

  • 0

    删除 Gemfile.lock 文件,然后运行 bundle installbundle update . 我不能保证这个选项应该有用,试试吧 .

Related