【问题标题】:Bundler could not find compatible versions for gem "devise"?Bundler 找不到 gem“设计”的兼容版本?
【发布时间】:2015-07-17 10:58:37
【问题描述】:

我在 bundle install 上收到此错误,这没有意义,因为 devise 3.3 已经安装。

错误:

Bundler could not find compatible versions for gem "devise":
  In Gemfile:
    devise_token_auth (>= 0) ruby depends on
      devise (~> 3.2) ruby

    spree_auth_devise (>= 0) ruby depends on
      devise (~> 2.2.3) ruby

    devise (~> 3.3) ruby

宝石文件:

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', "~> 4.2.1"
# Use postgresql as the database for Active Record
gem 'pg'

# Use Bootstrap-SASS
gem 'bootstrap-sass', '~> 3.3.4'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Downgrade version - Workaround for Windows
gem 'coffee-script-source', '1.8.0'

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'rails-api'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'therubyracer', group: :production
gem 'devise', '~> 3.3'
gem 'spree', github: 'spree/spree', branch: '3-0-stable'
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-3-stable'
gem 'devise_token_auth'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-google'
gem 'rake', '10.4.2'
gem 'yelp'
gem 'rack'
gem 'textacular', '~> 3.0'
gem 'byebug'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'rails_12factor', group: :production

gem 'rack-cors', :require => 'rack/cors'

gem 'aws-sdk'

【问题讨论】:

  • 您是否要安装devise_token_auth gem?发布Gemfile.lock的相关部分
  • 我正在尝试安装spree_auth_devisedevise_token_auth 已经安装。我已经删除了Gemfile.lock
  • 使用gem 'devise', '~&gt; 3.4.1' 更新gemfile 并尝试bundle
  • 为什么你在版本 3 中使用 spree 而在版本 1-3 中使用 spree_auth_devise ?来自:github.com/spree/spree_auth_devise#installation "请确保您使用的 spree_auth_devise 分支与您的 Spree 版本相关。"

标签: ruby-on-rails gemfile


【解决方案1】:

我有同样的问题,但版本较新,但正如输出所说,这是依赖问题

Bundler could not find compatible versions for gem "devise":
  In Gemfile:
    devise_token_auth (~> 0.1.37) ruby depends on
      devise (< 4.1, > 3.5.2) ruby

    devise (4.1.0)

我从 Gemfile 中取出 devise 的版本,以便捕获 devise_token_auth 正在使用的 devise 版本:

Using devise 4.0.2
...
Using devise_token_auth 0.1.37

所以你可以带着你获得的版本回到Gemfile

gem 'devise', '~> 4.0.2'
...
gem 'devise_token_auth', '~> 0.1.37'

【讨论】:

    猜你喜欢
    • 2011-10-31
    • 2017-07-17
    • 2018-02-09
    • 2014-05-26
    • 2014-03-14
    • 2013-03-13
    • 2019-05-07
    • 2016-02-17
    • 2013-03-12
    相关资源
    最近更新 更多