升级到Rails 6时的依赖性错误 bundle update之后的错误消息 gemfile

我正在按照以下说明从Rails 5.2升级到Rails 6:

https://blog.rubynetti.it/i/how-to-upgrade-to-rails-6-from-rails-5-2-1

运行bundle update时,出现以下错误,并且不知道如何解决。我尝试删除锁定文件,然后再次运行它,尝试运行bundle update railties,但收到一条错误消息,提示我应该运行“捆绑更新”

请帮助!

bundle update之后的错误消息

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

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

    factory_bot_rails was resolved to 5.1.1,which depends on
      railties (>= 4.2.0)

    jquery-ui-rails was resolved to 6.0.1,which depends on
      railties (>= 3.2.16)

    rails (~> 6.0,>= 6.0.2.1) was resolved to 6.0.2.1,which depends on
      railties (= 6.0.2.1)

    rspec-rails (~> 3.8) was resolved to 3.9.0,which depends on
      railties (>= 3.0)

    teaspoon-jasmine was resolved to 2.3.4,which depends on
      teaspoon (>= 1.0.0) was resolved to 1.1.4,which depends on
        railties (>= 3.2.5,< 5)

    web-console (>= 3.3.0) was resolved to 4.0.1,which depends on
      railties (>= 6.0.0)

    wicked was resolved to 1.3.4,which depends on
      railties (>= 3.0.7)

Bundler could not find compatible versions for gem "thor":
  In Gemfile:
    jquery-rails was resolved to 4.3.5,which depends on
      thor (>= 0.14,< 2.0)

    rails (~> 6.0,which depends on
      railties (= 6.0.2.1) was resolved to 6.0.2.1,which depends on
        thor (>= 0.20.3,< 2.0)

    select2-rails was resolved to 4.0.3,which depends on
      thor (~> 0.14)

gemfile

# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.5'

gem 'rails','~> 6.0','>= 6.0.2.1'
gem 'pg','~> 0.18.4'
gem 'active_hash'
gem 'bootsnap','>= 1.1.0',require: false
gem 'puma','~> 3.12'
gem 'sassc'
gem 'uglifier','>= 1.3.0'
gem 'bootstrap','~> 4.3.1'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'devise'
gem 'devise-bootstrap-views','~> 1.0'
gem 'devise-i18n'
gem 'simple_form','~> 5.0.1'
gem "select2-rails"
gem 'wicked'
gem 'pagy'
gem 'geocoder'
gem 'mailboxer'
gem 'stripe'
gem 'coffee-rails','~> 4.2'
gem 'turbolinks','~> 5'
gem 'jbuilder','~> 2.5'
gem 'activerecord-import'
gem 'rubocop',require: false
gem 'rubocop-rails'
gem 'rubocop-performance'

group :development,:test do
  gem 'byebug',platforms: %i[mri mingw x64_mingw]
  gem 'pry'
  gem 'rspec-rails','~>3.8'
  gem 'spring-commands-rspec'
  gem 'factory_bot_rails'
  gem 'database_cleaner'
  gem 'faker',git: 'https://github.com/stympy/faker.git',branch: 'master'
  gem "teaspoon-jasmine"
end

group :development do
  gem 'listen','>= 3.0.5'
  gem 'web-console','>= 3.3.0'
end

group :test do
  gem 'capybara','>= 2.15'
  gem 'selenium-webdriver'
  gem 'webdrivers','~> 4.0'  
  gem 'stripe-ruby-mock','~> 2.5.8',:require => 'stripe_mock'
end

gem 'tzinfo-data',platforms: %i[mingw mswin x64_mingw jruby]
gemfile.lock
GIT
  remote: https://github.com/stympy/faker.git
  revision: 585093235822362e345034da46945b6ea8ssed9d
  branch: master
  specs:
    faker (2.9.0)
      i18n (>= 1.6,< 1.8)

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.2.4.1)
      actionpack (= 5.2.4.1)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailer (5.2.4.1)
      actionpack (= 5.2.4.1)
      actionview (= 5.2.4.1)
      activejob (= 5.2.4.1)
      mail (~> 2.5,>= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.2.4.1)
      actionview (= 5.2.4.1)
      activesupport (= 5.2.4.1)
      rack (~> 2.0,>= 2.0.8)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0,>= 1.0.2)
    actionview (5.2.4.1)
      activesupport (= 5.2.4.1)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0,>= 1.0.3)
    active_hash (3.0.0)
      activesupport (>= 5.0.0)
    activejob (5.2.4.1)
      activesupport (= 5.2.4.1)
      globalid (>= 0.3.6)
    activemodel (5.2.4.1)
      activesupport (= 5.2.4.1)
    activerecord (5.2.4.1)
      activemodel (= 5.2.4.1)
      activesupport (= 5.2.4.1)
      arel (>= 9.0)
    activerecord-import (1.0.4)
      activerecord (>= 3.2)
    activestorage (5.2.4.1)
      actionpack (= 5.2.4.1)
      activerecord (= 5.2.4.1)
      marcel (~> 0.3.1)
    activesupport (5.2.4.1)
      concurrent-ruby (~> 1.0,>= 1.0.2)
      i18n (>= 0.7,< 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    addressable (2.7.0)
      public_suffix (>= 2.0.2,< 5.0)
    arel (9.0.0)
    ast (2.4.0)
    autoprefixer-rails (9.7.3)
      execjs
    bcrypt (3.1.13)
    bindex (0.8.1)
    bootsnap (1.4.5)
      msgpack (~> 1.0)
    bootstrap (4.3.1)
      autoprefixer-rails (>= 9.1.0)
      popper_js (>= 1.14.3,< 2)
      sassc-rails (>= 2.0.0)
    builder (3.2.4)
    byebug (11.0.1)
    capybara (3.30.0)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (~> 1.5)
      xpath (~> 3.2)
    carrierwave (2.0.2)
      activemodel (>= 5.0.0)
      activesupport (>= 5.0.0)
      addressable (~> 2.6)
      image_processing (~> 1.1)
      mimemagic (>= 0.3.0)
      mini_mime (>= 0.1.3)
    childprocess (3.0.0)
    coderay (1.1.2)
    coffee-rails (4.2.2)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.1.5)
    crass (1.0.5)
    dante (0.2.0)
    database_cleaner (1.7.0)
    devise (4.7.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0)
      responders
      warden (~> 1.2.3)
    devise-bootstrap-views (1.1.0)
    devise-i18n (1.9.0)
      devise (>= 4.7.1)
    diff-lcs (1.3)
    erubi (1.9.0)
    execjs (2.7.0)
    factory_bot (5.1.1)
      activesupport (>= 4.2.0)
    factory_bot_rails (5.1.1)
      factory_bot (~> 5.1.0)
      railties (>= 4.2.0)
    ffi (1.11.3)
    geocoder (1.5.2)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    i18n (1.7.0)
      concurrent-ruby (~> 1.0)
    image_processing (1.10.0)
      mini_magick (>= 4.9.5,< 5)
      ruby-vips (>= 2.0.13,< 3)
    jaro_winkler (1.5.4)
    jbuilder (2.9.1)
      activesupport (>= 4.2.0)
    jquery-rails (4.3.5)
      rails-dom-testing (>= 1,< 3)
      railties (>= 4.2.0)
      thor (>= 0.14,< 2.0)
    jquery-ui-rails (6.0.1)
      railties (>= 3.2.16)
    listen (3.2.1)
      rb-fsevent (~> 0.10,>= 0.10.3)
      rb-inotify (~> 0.9,>= 0.9.10)
    loofah (2.4.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    mailboxer (0.15.1)
      carrierwave (>= 0.5.8)
      rails (>= 5.0.0)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    method_source (0.9.2)
    mimemagic (0.3.3)
    mini_magick (4.9.5)
    mini_mime (1.0.2)
    mini_portile2 (2.4.0)
    minitest (5.13.0)
    msgpack (1.3.1)
    multi_json (1.14.1)
    nio4r (2.5.2)
    nokogiri (1.10.7)
      mini_portile2 (~> 2.4.0)
    orm_adapter (0.5.0)
    pagy (3.7.1)
    parallel (1.19.1)
    parser (2.7.0.0)
      ast (~> 2.4.0)
    pg (0.18.4)
    popper_js (1.14.5)
    pry (0.12.2)
      coderay (~> 1.1.0)
      method_source (~> 0.9.0)
    public_suffix (4.0.2)
    puma (3.12.2)
    rack (2.0.8)
    rack-test (1.1.0)
      rack (>= 1.0,< 3)
    rails (5.2.4.1)
      actioncable (= 5.2.4.1)
      actionmailer (= 5.2.4.1)
      actionpack (= 5.2.4.1)
      actionview (= 5.2.4.1)
      activejob (= 5.2.4.1)
      activemodel (= 5.2.4.1)
      activerecord (= 5.2.4.1)
      activestorage (= 5.2.4.1)
      activesupport (= 5.2.4.1)
      bundler (>= 1.3.0)
      railties (= 5.2.4.1)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.3.0)
      loofah (~> 2.3)
    railties (5.2.4.1)
      actionpack (= 5.2.4.1)
      activesupport (= 5.2.4.1)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.19.0,< 2.0)
    rainbow (3.0.0)
    rake (13.0.1)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    regexp_parser (1.6.0)
    responders (3.0.0)
      actionpack (>= 5.0)
      railties (>= 5.0)
    rspec-core (3.9.0)
      rspec-support (~> 3.9.0)
    rspec-expectations (3.9.0)
      diff-lcs (>= 1.2.0,< 2.0)
      rspec-support (~> 3.9.0)
    rspec-mocks (3.9.0)
      diff-lcs (>= 1.2.0,< 2.0)
      rspec-support (~> 3.9.0)
    rspec-rails (3.9.0)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 3.9.0)
      rspec-expectations (~> 3.9.0)
      rspec-mocks (~> 3.9.0)
      rspec-support (~> 3.9.0)
    rspec-support (3.9.0)
    rubocop (0.78.0)
      jaro_winkler (~> 1.5.1)
      parallel (~> 1.10)
      parser (>= 2.6)
      rainbow (>= 2.2.2,< 4.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (>= 1.4.0,< 1.7)
    rubocop-performance (1.5.2)
      rubocop (>= 0.71.0)
    rubocop-rails (2.4.1)
      rack (>= 1.1)
      rubocop (>= 0.72.0)
    ruby-progressbar (1.10.1)
    ruby-vips (2.0.16)
      ffi (~> 1.9)
    rubyzip (2.0.0)
    sassc (2.2.1)
      ffi (~> 1.9)
    sassc-rails (2.1.2)
      railties (>= 4.0.0)
      sassc (>= 2.0)
      sprockets (> 3.0)
      sprockets-rails
      tilt
    select2-rails (4.0.3)
      thor (~> 0.14)
    selenium-webdriver (3.142.7)
      childprocess (>= 0.5,< 4.0)
      rubyzip (>= 1.2.2)
    simple_form (5.0.1)
      actionpack (>= 5.0)
      activemodel (>= 5.0)
    spring (2.1.0)
    spring-commands-rspec (1.0.4)
      spring (>= 0.9.1)
    sprockets (4.0.0)
      concurrent-ruby (~> 1.0)
      rack (> 1,< 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    stripe (5.11.0)
    stripe-ruby-mock (2.5.8)
      dante (>= 0.2.0)
      multi_json (~> 1.0)
      stripe (>= 2.0.3)
    teaspoon (1.1.5)
      railties (>= 3.2.5,< 6)
    teaspoon-jasmine (2.3.4)
      teaspoon (>= 1.0.0)
    thor (0.20.3)
    thread_safe (0.3.6)
    tilt (2.0.10)
    turbolinks (5.2.1)
      turbolinks-source (~> 5.2)
    turbolinks-source (5.2.0)
    tzinfo (1.2.6)
      thread_safe (~> 0.1)
    uglifier (4.2.0)
      execjs (>= 0.3.0,< 3)
    unicode-display_width (1.6.0)
    warden (1.2.8)
      rack (>= 2.0.6)
    web-console (3.7.0)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      bindex (>= 0.4.0)
      railties (>= 5.0)
    webdrivers (4.1.3)
      nokogiri (~> 1.6)
      rubyzip (>= 1.3.0)
      selenium-webdriver (>= 3.0,< 4.0)
    websocket-driver (0.7.1)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.4)
    wicked (1.3.4)
      railties (>= 3.0.7)
    xpath (3.2.0)
      nokogiri (~> 1.8)

PLATFORMS
  ruby

DEPENDENCIES
  active_hash
  activerecord-import
  bootsnap (>= 1.1.0)
  bootstrap (~> 4.3.1)
  byebug
  capybara (>= 2.15)
  coffee-rails (~> 4.2)
  database_cleaner
  devise
  devise-bootstrap-views (~> 1.0)
  devise-i18n
  factory_bot_rails
  faker!
  geocoder
  jbuilder (~> 2.5)
  jquery-rails
  jquery-ui-rails
  listen (>= 3.0.5)
  mailboxer
  pagy
  pg (~> 0.18.4)
  pry
  puma (~> 3.12)
  rails (~> 5.2.3)
  rspec-rails (~> 3.8)
  rubocop
  rubocop-performance
  rubocop-rails
  sassc
  select2-rails
  selenium-webdriver
  simple_form (~> 5.0.1)
  spring-commands-rspec
  stripe
  stripe-ruby-mock (~> 2.5.8)
  teaspoon-jasmine
  turbolinks (~> 5)
  tzinfo-data
  uglifier (>= 1.3.0)
  web-console (>= 3.3.0)
  webdrivers (~> 4.0)
  wicked

RUBY VERSION
   ruby 2.6.5p114

BUNDLED WITH
   2.0.2
lyj5360 回答:升级到Rails 6时的依赖性错误 bundle update之后的错误消息 gemfile

升级时,我遇到了类似的问题。这些依赖关系警告中有很多杂音,因此查找问题可能很棘手,因此,所有这些都与知道在哪里查找有关。幸运的是,与我一起工作的一位开发人员能够帮助我。

铁路

这里的问题是railties(因为它是带有rails的gem)正试图升级到版本6,但是您的teaspoon-jasmine gem具有从属关系({{1} }),需要teaspoon railties。在大多数情况下,您可能希望将>= 3.2.5,< 5升级到支持rails 6的版本,但是看起来您拥有teaspoon-jasmine(2.3.4)的最新版本,因此我想研究一下如果可以的话,请删除它,并用仍在维护的gem替换它,或者如果需要,可以将该gem派生并配置为与rails 6配合使用。

thor

这里非常相似的问题很可能与teaspoon-jasmine有关。自2016年以来,该gem似乎尚未更新,它需要旧版本的select2-rails。有关该宝石here的信息,请参见gemspec。我会在这里做同样的事情,并考虑摆脱thor,如果可以的话,将其替换为仍在维护的gem,或者如果需要的话,您可以分叉该gem并将其配置为可以使用导轨6。

我希望这会有所帮助。

本文链接:https://www.f2er.com/2853041.html

大家都在问