Rails 5升级错误-Bundler找不到与gem“ actionpack”兼容的版本:

时间:2019-03-03 00:57:02

标签: ruby-on-rails ruby

我整天都被这些错误困扰,没有任何解决方法。我希望有人可以在此站点上为我提供帮助。我已经在该网站和在线上阅读了许多类似的问题,但似乎没有一个起作用。我正在尝试将Rails从4.2.2升级到5.1.6。但是,每次运行捆绑安装时,我仍然继续收到以下错误。

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    active_model_serializers (= 0.10.9) was resolved to 0.10.9, which depends on
    actionpack (< 6, >= 4.1)

    axlsx_rails (= 0.5.2) was resolved to 0.5.2, which depends on
      actionpack (>= 3.1)

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

    responders (~> 2.0) was resolved to 2.4.1, which depends on
      actionpack (< 6.0, >= 4.2.0)

Bundler could not find compatible versions for gem "actionview":
  In Gemfile:
    rails (= 5.1.6) was resolved to 5.1.6, which depends on
      actionview (= 5.1.6)

    web-console (= 3.5.1) was resolved to 3.5.1, which depends on
      actionview (>= 5.0)

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

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

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

    web-console (= 3.5.1) was resolved to 3.5.1, which depends on
      activemodel (>= 5.0)

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

    jbuilder (= 2.7.0) was resolved to 2.7.0, which depends on
      activesupport (>= 4.2.0)

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

    spring (= 2.0.2) was resolved to 2.0.2, which depends on
      activesupport (>= 4.2)

Bundler could not find compatible versions for gem "json":
  In Gemfile:
    fog (= 1.42) was resolved to 1.42.0, which depends on
      json (~> 2.0)

    sdoc (= 0.4.0) was resolved to 0.4.0, which depends on
      json (~> 1.8)

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

    mini_backtrace (= 0.1.3) was resolved to 0.1.3, which depends on
      rails (>= 2.3.3)

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    coffee-rails (= 4.2.2) was resolved to 4.2.2, which depends on
      railties (>= 4.0.0)

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

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

    responders (~> 2.0) was resolved to 2.4.1, which depends on
      railties (< 6.0, >= 4.2.0)

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

    web-console (= 3.5.1) was resolved to 3.5.1, which depends on
      railties (>= 5.0)

我已尝试更新所有宝石,从而将错误提供给最新版本,但这似乎无济于事。我还删除了没有帮助的gem.lock文件。

我的gem文件是:

source 'https://rubygems.org'

ruby '2.4.5'
gem 'rails',                   '5.1.6'

gem 'bcrypt',                  '3.1.12'
gem 'faker',                   '1.7.3'
gem 'carrierwave',             '1.2.2'
gem 'mini_magick',             '4.7.0'
gem 'fog',                     '1.42'
gem 'will_paginate',           '3.1.6'
gem 'bootstrap-will_paginate', '1.0.0'
gem 'bootstrap-sass',          '3.3.7'
gem 'sass-rails',              '5.0.6'
gem 'uglifier',                '3.2.0'
gem 'coffee-rails',            '4.2.2'
gem 'jquery-rails',            '4.3.1'
gem 'turbolinks',              '5.0.1'
gem 'jbuilder',                '2.7.0'
gem 'sdoc',                    '0.4.0', group: :doc
gem 'axlsx',                   '2.0.1'
gem 'axlsx_rails',             '0.5.2'
gem 'prawn'
gem 'prawn-table'
gem 'aws-sdk',                 '~> 2'
gem 'multipart-post'

#api gems
gem 'active_model_serializers', '0.10.9'
gem 'responders',               '~> 2.0'

gem "recaptcha",    require: "recaptcha/rails"

group :development, :test do
  gem 'sqlite3',     '1.3.9'
  gem 'byebug',      '9.0.6', platform: :mri
  gem 'web-console',           '3.5.1'
  gem 'listen',                '3.1.5'
  gem 'spring',                '2.0.2'
  gem 'spring-watcher-listen', '2.0.1'
end

group :test do
  gem 'minitest-reporters', '1.0.5'
  gem 'mini_backtrace',     '0.1.3'
  gem 'guard-minitest',     '2.3.1'
end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
  gem 'puma',           '3.9.1'
end 

任何帮助将不胜感激!我已经失去了今天要想弄清楚的大部分内容!

0 个答案:

没有答案