微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Bundler 在 rails 中的 bundle install 中找不到兼容的版本

如何解决Bundler 在 rails 中的 bundle install 中找不到兼容的版本

我克隆了一个现有项目并尝试在我的系统中运行它。 由于这是第一次我的目录中没有任何 Gemfile.lock 文件。 我尝试运行 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-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
          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,< 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,< 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
        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-store (>= 1.1.0,< 2)

    redis-rails (= 5.0.2) was resolved to 5.0.2,which depends on
        redis-store (>= 1.3,< 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
        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,< 4.0)

    chosen-rails was resolved to 1.9.0,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,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
        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

宝石环境:

 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版本1.17.3(所以bundle版本没有问题)

解决方法

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

找不到 gem 'mimemagic (= 0.3.0)',这是 gem 'paperclip (~> 4.3.2)' 所需的,在 任何来源。

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

关于这个在 google 上很容易找到的多个讨论(当然,如果你知道你在搜索什么!),例如 hereherehere

理想的解决方法是更新使用较新 mimemagic 版本所需的任何库。 (在您的情况下,也许它只是 paperclip?)如果没有看到您的完整 Gemfile.lock,我无法确定。

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

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

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

,

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

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。