【问题标题】:bundle install gives me a lot of gems version errorsbundle install 给了我很多 gems 版本错误
【发布时间】:2021-09-22 08:30:03
【问题描述】:

当我运行 bundle install 时,我得到了这个很长的错误

bundle install
Fetching gem metadata from https://rails-assets.org/...
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rails-assets.org/..
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......................
Bundler could not find compatible versions for gem "actionmailer":
  In Gemfile:
    mail_form was resolved to 1.7.1, which depends on
      actionmailer (>= 3.2, < 6)

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

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    activeadmin was resolved to 1.4.3, which depends on
      formtastic (~> 3.1) was resolved to 3.1.5, which depends on
        actionpack (>= 3.2.13)

    activeadmin was resolved to 1.4.3, which depends on
      inherited_resources (>= 1.9.0) was resolved to 1.9.0, which depends on
        has_scope (~> 0.6) was resolved to 0.7.2, which depends on
          actionpack (>= 4.1)

    activeadmin was resolved to 1.4.3, which depends on
      inherited_resources (>= 1.9.0) was resolved to 1.9.0, which depends on
        actionpack (>= 4.2, < 5.3)

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

    activeadmin was resolved to 1.4.3, which depends on
      ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
        actionpack (>= 3.0, < 5.2)

Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    mail_form was resolved to 1.7.1, which depends on
      activemodel (>= 3.2, < 6)

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

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

    web-console (~> 2.0) was resolved to 2.3.0, which depends on
      activemodel (>= 4.0)

Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    friendly_id (~> 5.4.0) was resolved to 5.4.2, which depends on
      activerecord (>= 4.0.0)

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

    rails-erd was resolved to 1.6.1, which depends on
      activerecord (>= 4.2)

    activeadmin was resolved to 1.4.3, which depends on
      ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
        activerecord (>= 3.0, < 5.2)

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    activeadmin was resolved to 1.4.3, which depends on
      arbre (>= 1.1.1) was resolved to 1.4.0, which depends on
        activesupport (>= 3.0.0, < 6.2)

    jbuilder (~> 2.0) was resolved to 2.9.1, which depends on
      activesupport (>= 4.2.0)

    activeadmin was resolved to 1.4.3, which depends on
      kaminari (>= 0.15) was resolved to 1.2.1, which depends on
        activesupport (>= 4.1.0)

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

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

    activeadmin was resolved to 1.4.3, which depends on
      ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
        activesupport (>= 3.0, < 5.2)

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

    activeadmin was resolved to 1.4.3, which depends on
      coffee-rails

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

    activeadmin was resolved to 1.4.3, which depends on
      ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
        i18n

Bundler could not find compatible versions for gem "json":
  In Gemfile:
    recaptcha was resolved to 5.8.1, which depends on
      json

    sdoc (~> 0.4.0) was resolved to 0.4.2, which depends on
      json (~> 1.7, >= 1.7.7)

Bundler could not find compatible versions for gem "mimemagic":
  In Gemfile:
    paperclip (~> 4.3.1) 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.1)', in any of the sources.

Bundler could not find compatible versions for gem "paperclip":
  In Gemfile:
    paperclip (~> 4.3.1)

    paperclip-ffmpeg (~> 1.2.0) was resolved to 1.2.0, which depends on
      paperclip (>= 2.5.2)

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

    omniauth-google-oauth2 was resolved to 1.0.0, which depends on
      oauth2 (~> 1.1) was resolved to 1.4.7, which depends on
        rack (>= 1.2, < 3)

    omniauth-google-oauth2 was resolved to 1.0.0, which depends on
      omniauth (~> 2.0) was resolved to 2.0.4, which depends on
        rack (>= 1.6.2, < 3)

    sass-rails (~> 5.0) was resolved to 5.0.7, 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.8.0, 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.2.11.1)

    paperclip-ffmpeg (~> 1.2.0) was resolved to 1.2.0, which depends on
      rails

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    activeadmin was resolved to 1.4.3, which depends on
      railties (>= 4.2, < 5.3)

    coffee-rails (~> 4.1.0) was resolved to 4.1.1, which depends on
      railties (>= 4.0.0, < 5.1.x)

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

    activeadmin was resolved to 1.4.3, which depends on
      jquery-rails (>= 4.2.0) was resolved to 4.4.0, which depends on
        railties (>= 4.2.0)

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

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

    web-console (~> 2.0) was resolved to 2.3.0, which depends on
      railties (>= 4.0)

Bundler could not find compatible versions for gem "sprockets":
  In Gemfile:
    activeadmin was resolved to 1.4.3, which depends on
      sprockets (< 4.1)

    sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
      sprockets (>= 2.8, < 4.0)

Bundler could not find compatible versions for gem "thor":
  In Gemfile:
    thor (= 0.19.1)

    activeadmin was resolved to 1.4.3, which depends on
      jquery-rails (>= 4.2.0) was resolved to 4.4.0, which depends on
        thor (>= 0.14, < 2.0)

    rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
      railties (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
        thor (>= 0.18.1, < 2.0)

这是我的 gemfile

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.11.1'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.20.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.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

# 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

# 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 do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

gem 'devise'
group :development, :test do
  gem "interactive_editor"
  gem "hirb"
  gem "awesome_print"
  gem 'byebug'
end
group :production do
  gem 'rails_12factor'
  gem 'puma'
end
gem 'mail_form'
gem 'font-awesome-sass', '~> 5.12.0'

gem 'bootsnap', '>= 1.1.0', require: false
gem 'bootstrap-sass', '~>3.2.0'

gem 'paperclip', '~> 4.3.1'

gem 'aws-sdk-s3'
gem 'aws-sdk', '< 2.0'

gem 'thor', '0.19.1'
gem 'omniauth-google-oauth2'
gem "recaptcha", require: "recaptcha/rails"
gem 'friendly_id', '~> 5.4.0'

gem 'activeadmin'
gem 'rails-assets-sweetalert2', source: 'https://rails-assets.org'
gem 'sweet-alert2-rails'
gem 'sweet-alert-confirm'
gem 'cocoon'
gem 'bigdecimal', '1.3.5'
gem 'paperclip-av-transcoder'
gem "paperclip-ffmpeg", "~> 1.2.0"
gem "will_paginate", "~> 3.0.4" 
gem 'rails-erd'
gem 'bundler', '1.17.3' 

我该如何解决? 在我更改捆绑版本后出现此错误

【问题讨论】:

    标签: ruby-on-rails rubygems bundle


    【解决方案1】:

    正如错误消息所说。您在 gem 文件中指定的版本不可用。发生这种情况是因为每个捆绑包版本仅支持特定版本,例如它可以下载 2 及更高版本的任何版本,但版本 1 不可用。我看到你的宝石已经过时了,你应该考虑只更新它们。除非您已经完成了特定于版本的操作,否则对于 rails 版本 4.2,您应该不再需要这些限制。如果不是,您必须回滚您的捆绑版本。

    【讨论】:

      【解决方案2】:

      错误是mimemagicpaperclip需要。

      您必须从源代码升级或提供 mimemagic gem。
      这发生在我身上,必须从旧项目中获取代码才能提供它。

      供参考: https://github.com/rails/rails/issues/41750

      【讨论】:

        猜你喜欢
        • 2022-01-06
        • 1970-01-01
        • 1970-01-01
        • 2012-04-21
        • 1970-01-01
        • 2022-01-03
        • 2020-01-15
        • 1970-01-01
        • 2013-01-05
        相关资源
        最近更新 更多