Bundler 在 rails 中的捆绑安装中找不到兼容版本

Bundler couldn't find compatable versions on bundle install in rails

我已经克隆了一个现有的项目并试图在我的系统中运行它。 因为这是我第一次在我的目录中没有任何 Gemfile.lock 文件。 我尝试了 运行ning bundle install 并出现了以下错误:

Bundler could not find compatible versions for gem "actionmailer":
  In Gemfile:
    liquid_markdown (= 0.2.2) was resolved to 0.2.2, which depends on
      actionmailer (>= 4.0)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      actionmailer (= 4.1.6)

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    gon (= 6.4.0) was resolved to 6.4.0, which depends on
      actionpack (>= 3.0.20)

    jquery-datatables-rails (= 3.3.0) was resolved to 3.3.0, which depends on
      actionpack (>= 3.1)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      actionpack (= 4.1.6)

    rails-api was resolved to 0.4.1, which depends on
      actionpack (>= 3.2.11)

    redis-rails (= 5.0.2) was resolved to 5.0.2, which depends on
      redis-actionpack (>= 5.0, < 6) was resolved to 5.1.0, which depends on
        actionpack (>= 4.0, < 7)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      sprockets-rails (~> 2.0) was resolved to 2.3.3, which depends on
        actionpack (>= 3.0)

Bundler could not find compatible versions for gem "actionview":
  In Gemfile:
    liquid_markdown (= 0.2.2) was resolved to 0.2.2, which depends on
      actionview (>= 4.0)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      actionview (= 4.1.6)

Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    acts_as_api (= 1.0.1) was resolved to 1.0.1, which depends on
      activemodel (>= 3.0.0)

    carrierwave was resolved to 1.3.2, which depends on
      activemodel (>= 4.0.0)

    paperclip (~> 4.3.2) was resolved to 4.3.7, which depends on
      activemodel (>= 3.2.0)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      activemodel (= 4.1.6)

Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    audited (= 4.8.0) was resolved to 4.8.0, which depends on
      activerecord (>= 4.0, < 5.3)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      activerecord (= 4.1.6)

    squeel was resolved to 1.2.3, which depends on
      activerecord (>= 3.0)

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    acts_as_api (= 1.0.1) was resolved to 1.0.1, which depends on
      activesupport (>= 3.0.0)

    carrierwave was resolved to 1.3.2, which depends on
      activesupport (>= 4.0.0)

    paperclip (~> 4.3.2) was resolved to 4.3.7, which depends on
      activesupport (>= 3.2.0)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      activesupport (= 4.1.6)

    redis-rails (= 5.0.2) was resolved to 5.0.2, which depends on
      redis-activesupport (>= 5.0, < 6) was resolved to 5.2.0, which depends on
        activesupport (>= 3, < 7)

Bundler could not find compatible versions for gem "coffee-rails":
  In Gemfile:
    coffee-rails (~> 4.0.0)

    chosen-rails was resolved to 1.9.0, which depends on
      coffee-rails (>= 3.2)

Bundler could not find compatible versions for gem "i18n":
  In Gemfile:
    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      activesupport (= 4.1.6) was resolved to 4.1.6, which depends on
        i18n (~> 0.6, >= 0.6.9)

    gon (= 6.4.0) was resolved to 6.4.0, which depends on
      i18n (>= 0.7)

Bundler could not find compatible versions for gem "mime-types":
  In Gemfile:
    carrierwave was resolved to 1.3.2, which depends on
      mime-types (>= 1.16)

    paperclip (~> 4.3.2) was resolved to 4.3.7, which depends on
      mime-types

    rest-client (~> 1.7.2) was resolved to 1.7.3, which depends on
      mime-types (>= 1.16, < 3.0)

Bundler could not find compatible versions for gem "mimemagic":
  In Gemfile:
    paperclip (~> 4.3.2) was resolved to 4.3.7, which depends on
      mimemagic (= 0.3.0)

Could not find gem 'mimemagic (= 0.3.0)', which is required by gem 'paperclip (~> 4.3.2)', in
any of the sources.

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      actionpack (= 4.1.6) was resolved to 4.1.6, which depends on
        rack (~> 1.5.2)

    acts_as_api (= 1.0.1) was resolved to 1.0.1, which depends on
      rack (>= 1.1.0)

    resque-scheduler was resolved to 4.4.0, which depends on
      resque (>= 1.26) was resolved to 1.27.4, which depends on
        sinatra (>= 0.9.2) was resolved to 1.4.8, which depends on
          rack-protection (~> 1.4) was resolved to 1.5.5, which depends on
            rack

    redis-rails (= 5.0.2) was resolved to 5.0.2, which depends on
      redis-actionpack (>= 5.0, < 6) was resolved to 5.1.0, which depends on
        redis-rack (>= 1, < 3) was resolved to 2.0.6, which depends on
          rack (>= 1.5, < 3)

    request_store (= 1.4.1) was resolved to 1.4.1, which depends on
      rack (>= 1.4)

    resque-scheduler was resolved to 4.4.0, which depends on
      resque (>= 1.26) was resolved to 1.27.4, which depends on
        sinatra (>= 0.9.2) was resolved to 1.4.8, which depends on
          rack (~> 1.5)

    sass-rails (= 5.0.6) was resolved to 5.0.6, which depends on
      sprockets (>= 2.8, < 4.0) was resolved to 3.7.2, which depends on
        rack (> 1, < 3)

    devise was resolved to 4.7.3, which depends on
      warden (~> 1.2.3) was resolved to 1.2.7, which depends on
        rack (>= 1.0)

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    rails (= 4.1.6)

    bootstrap-tooltip-rails was resolved to 0.1, which depends on
      rails (>= 3.1)

    has_magic_fields (= 0.2.1) was resolved to 0.2.1, which depends on
      rails (>= 4.0.0)

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    bootstrap-daterangepicker-rails (= 0.1.5) was resolved to 0.1.5, which depends on
      railties (>= 4.0, < 5.1)

    bootstrap-slider-rails (= 9.2.0) was resolved to 9.2.0, which depends on
      railties (>= 3.2, < 6.0)

    coffee-rails (~> 4.0.0) was resolved to 4.0.1, which depends on
      railties (>= 4.0.0, < 5.0)

    data-confirm-modal (= 1.2.0) was resolved to 1.2.0, which depends on
      railties (>= 3.0)

    devise was resolved to 4.7.3, which depends on
      railties (>= 4.1.0)

    font-awesome-rails was resolved to 4.7.0.7, which depends on
      railties (>= 3.2, < 7)

    jquery-datatables-rails (= 3.3.0) was resolved to 3.3.0, which depends on
      jquery-rails was resolved to 3.1.5, which depends on
        railties (>= 3.0, < 5.0)

    jquery-tablesorter was resolved to 1.27.2, which depends on
      railties (>= 3.2)

    momentjs-rails (= 2.15.1) was resolved to 2.15.1, which depends on
      railties (>= 3.1)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      railties (= 4.1.6)

    rails-api was resolved to 0.4.1, which depends on
      railties (>= 3.2.11)

    sass-rails (= 5.0.6) was resolved to 5.0.6, which depends on
      railties (>= 4.0.0, < 6)

    chosen-rails was resolved to 1.9.0, which depends on
      sassc-rails (>= 2.1.2) was resolved to 2.1.2, which depends on
        railties (>= 4.0.0)

Bundler could not find compatible versions for gem "redis":
  In Gemfile:
    redis-namespace (= 1.5.3) was resolved to 1.5.3, which depends on
      redis (~> 3.0, >= 3.0.4)

    redis-rails (= 5.0.2) was resolved to 5.0.2, which depends on
      redis-store (>= 1.2, < 2) was resolved to 1.6.0, which depends on
        redis (>= 2.2, < 5)

    resque-scheduler was resolved to 4.4.0, which depends on
      redis (>= 3.3)

Bundler could not find compatible versions for gem "redis-namespace":
  In Gemfile:
    redis-namespace (= 1.5.3)

    resque-scheduler was resolved to 4.4.0, which depends on
      resque (>= 1.26) was resolved to 1.27.4, which depends on
        redis-namespace (~> 1.3)

Bundler could not find compatible versions for gem "redis-store":
  In Gemfile:
    redis-rails (= 5.0.2) was resolved to 5.0.2, which depends on
      redis-actionpack (>= 5.0, < 6) was resolved to 5.1.0, which depends on
        redis-store (>= 1.1.0, < 2)

    redis-rails (= 5.0.2) was resolved to 5.0.2, which depends on
      redis-activesupport (>= 5.0, < 6) was resolved to 5.2.0, which depends on
        redis-store (>= 1.3, < 2)

    redis-rails (= 5.0.2) was resolved to 5.0.2, which depends on
      redis-store (>= 1.2, < 2)

Bundler could not find compatible versions for gem "resque":
  In Gemfile:
    resque

    resque-scheduler was resolved to 4.4.0, which depends on
      resque (>= 1.26)

Bundler could not find compatible versions for gem "ruby":
  In Gemfile:
    ruby

    bootstrap (~> 4.4.1) was resolved to 4.4.1, which depends on
      ruby (>= 2.3.3)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      bundler (>= 1.3.0, < 2.0) was resolved to 1.17.3, which depends on
        ruby (>= 1.8.7)

    byebug (= 11.0.1) was resolved to 11.0.1, which depends on
      ruby (>= 2.3.0)

    devise was resolved to 4.7.3, which depends on
      ruby (>= 2.1.0)

    gon (= 6.4.0) was resolved to 6.4.0, which depends on
      ruby (>= 2.2.0)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      activesupport (= 4.1.6) was resolved to 4.1.6, which depends on
        minitest (~> 5.1) was resolved to 5.14.4, which depends on
          ruby (>= 2.2, < 4.0)

    aws-sdk (< 2.0) was resolved to 1.67.0, which depends on
      aws-sdk-v1 (= 1.67.0) was resolved to 1.67.0, which depends on
        nokogiri (~> 1) was resolved to 1.11.3, which depends on
          ruby (>= 2.5.0)

    pg (= 0.21.0) was resolved to 0.21.0, which depends on
      ruby (>= 2.0.0)

    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      ruby (>= 1.9.3)

    rest-client (~> 1.7.2) was resolved to 1.7.3, which depends on
      ruby (>= 1.9.2)

    sentry-raven (= 2.6.0) was resolved to 2.6.0, which depends on
      ruby (>= 1.9.0)

Bundler could not find compatible versions for gem "sass-rails":
  In Gemfile:
    sass-rails (= 5.0.6)

    jquery-datatables-rails (= 3.3.0) was resolved to 3.3.0, which depends on
      sass-rails

Bundler could not find compatible versions for gem "sprockets":
  In Gemfile:
    sass-rails (= 5.0.6) was resolved to 5.0.6, which depends on
      sprockets (>= 2.8, < 4.0)

    chosen-rails was resolved to 1.9.0, which depends on
      sassc-rails (>= 2.1.2) was resolved to 2.1.2, which depends on
        sprockets (> 3.0)

Bundler could not find compatible versions for gem "sprockets-rails":
  In Gemfile:
    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      sprockets-rails (~> 2.0)

    sass-rails (= 5.0.6) was resolved to 5.0.6, which depends on
      sprockets-rails (>= 2.0, < 4.0)

    chosen-rails was resolved to 1.9.0, which depends on
      sassc-rails (>= 2.1.2) was resolved to 2.1.2, which depends on
        sprockets-rails

Bundler could not find compatible versions for gem "tzinfo":
  In Gemfile:
    rails (= 4.1.6) was resolved to 4.1.6, which depends on
      activesupport (= 4.1.6) was resolved to 4.1.6, which depends on
        tzinfo (~> 1.1)

    resque-scheduler was resolved to 4.4.0, which depends on
      rufus-scheduler (~> 3.2) was resolved to 3.7.0, which depends on
        fugit (~> 1.1, >= 1.1.6) was resolved to 1.4.4, which depends on
          et-orbi (~> 1.1, >= 1.1.8) was resolved to 1.2.4, which depends on
            tzinfo

宝石文件:

source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use mysql as the database for Active Record
gem 'pg', '0.21.0'

gem 'pushpad', '0.12.0'
gem 'gon', '6.4.0'

source 'https://rails-assets.org' do
  gem 'rails-assets-datetimepicker'
end
gem 'sass-rails', '5.0.6'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'has_magic_fields', '0.2.1'
gem 'bootstrap-tooltip-rails'
gem 'bootstrap-multiselect-rails'
gem 'bootstrap-datepicker-rails'
gem 'multi-select-rails'
gem 'remotipart', '~> 1.2'
gem 'request_store', '1.4.1'
gem 'plyr-rails'
gem "audited", '4.8.0'
gem 'jquery-datatables', '1.10.20'
gem 'telephone_number', '1.3.4'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'mini_racer'
gem 'acts_as_api', '1.0.1'
gem 'clipboard-rails'
gem 'bson_ext'
gem 'squeel'
gem 'workflow'
gem 'devise'
gem 'rack-cors', :require => 'rack/cors'
gem 'rest-client', '~> 1.7.2'
gem 'httpclient'
gem 'will_paginate', '~> 3.1.0'
gem 'rails-api'
gem 'bootstrap', '~> 4.4.1'
gem 'bootstrap_form', '2.7.0'
gem "cocoon"
gem 'chartkick', '2.2.4'
gem 'redis-rails', '5.0.2'
gem 'redis-namespace', "1.5.3"
gem "font-awesome-rails"
gem 'chosen-rails'
gem "cancan", "1.6.10"
gem "figaro"
gem 'jquery-tablesorter'
gem 'geocoder'
gem 'icheck-rails', '1.0.2.2'
gem 'bootstrap-slider-rails', '9.2.0'
gem 'haml', '4.0.7'
gem 'data-confirm-modal', "1.2.0"
gem "momentjs-rails", "2.15.1"
gem "bootstrap-daterangepicker-rails", "0.1.5"
gem "paperclip", "~> 4.3.2"
gem "underscore-rails"
gem "gmaps4rails"
gem "jquery-datatables-rails", "3.3.0"
gem 'carrierwave'
gem 'resque'
gem 'resque-scheduler'
gem 'liquid_markdown', '0.2.2'
gem 'aws-sdk', '< 2.0'
group :production do
  gem 'zip'
  gem "sentry-raven", "2.6.0"
end

group :test, :development do
  gem 'byebug', '11.0.1'
end

rvm 列表:

=* ruby-2.3.3 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

gem环境:

 RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.8
  - RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/bala/.rvm/gems/ruby-2.3.3
  - USER INSTALLATION DIRECTORY: /home/bala/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /usr/share/rvm/rubies/ruby-2.3.3/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /home/bala/.rvm/gems/ruby-2.3.3/bin
  - SPEC CACHE DIRECTORY: /home/bala/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/bala/.rvm/gems/ruby-2.3.3
     - /usr/share/rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/bala/.rvm/gems/ruby-2.3.3/bin
     - /home/bala/.rvm/gems/ruby-2.3.3@global/bin
     - /usr/share/rvm/rubies/ruby-2.3.3/bin
     - /usr/share/rvm/bin
     - /home/bala/.local/bin
     - /home/bala/anaconda3/condabin
     - /home/bala/.local/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /snap/bin
     - /home/bala/.rvm/bin
     - /home/bala/.rvm/bin
     - /home/bala/.rvm/bin

捆绑器——版本: 捆绑器版本 1.17.3

谁能帮帮我,我才知道我必须使用bundle version 1.17.3(所以bundle版本没有问题)

在您的项目目录中,尝试安装 rails gem install rails -v 4.1.6 并从失败的 gem 中删除版本,例如(liquid_markdowngon 等),然后尝试运行 bundle update 然后 bundle clean --force

我认为这可能是个问题,因为这些 gems 的所有版本都被锁定在您的 Gemfile 中

这个问题与 mimemagic 有关。更具体地说,这个错误:

Could not find gem 'mimemagic (= 0.3.0)', which is required by gem 'paperclip (~> 4.3.2)', in any of the sources.

最近 ruby 社区发生了一件大事,如 all old versions of this gem were suddenly yanked (hard-deleted) from rubygems,在作者意识到该库被错误地许可为 MIT 而不是 GPLv2 之后。

在 google 上很容易找到关于此的多个讨论(当然,如果您知道自己在搜索什么!),例如 here, here and here.

理想的解决方法是更新使用较新 mimemagic 版本所需的所有库。 (也许你的情况只是 paperclip?)如果没有看到你的完整 Gemfile.lock,我不能肯定地说。

但是,如果现在这不可行,而您只想使用 v0.3.0 of mimemagic, you could always look through the git history 进行安装并将该版本的提交固定在 Gemfile:

gem 'mimemagic', git: 'https://github.com/mimemagicrb/mimemagic', ref: 'a4b038c6c1b9d76dac33d5711d28aaa9b4c42c66'

但是,请注意 - 如上所述 - 这个 gem 的旧版本确实应该 GPLv2 获得许可,而不是 MIT 许可。对于本地开发来说,这绝对不是问题;但对于生产部署,它 可能 是一个法律问题。我不是律师。