简体   繁体   中英

Railties compatibility issue while upgrading to Rails 5.2.2

I am trying to update a Rails app from Rails 5.2.0.rc2 to Rails 5.2.2

So far, I:

  • Deleted gemfile.lock
  • Removed version numbers from most gems in the gem file
  • Upgraded version to 5.2.2 for the rails gem in the gem file

When I run bundle update or bundle install , I get this error:

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

    font-awesome5-rails was resolved to 1.0.1, which depends on
      railties (< 5.2, >= 3.2)

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

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

    rails-i18n was resolved to 5.1.3, which depends on
      railties (< 6, >= 5.0)

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

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

If i try bundle update rails , I get:

This Bundle hasn't been installed yet. Run `bundle install` to update and install the bundled gems.

Here is my Gemfile:

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

gem 'rails',                   '5.2.2'
gem 'bcrypt',                  '3.1.11'
gem 'faker',                   '1.7.3'
gem 'mini_magick',             '4.8'
gem 'nokogiri',                '1.8.1'
gem 'will_paginate',           '3.1.6'
gem 'will_paginate-bootstrap4'
gem 'bootstrap',               '~> 4.2.1'
gem 'puma',                    '3.11'
gem 'sass-rails'
gem 'uglifier'
gem 'mini_racer',              platforms: :ruby
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder',                '2.7.0'
gem 'rails-i18n'
gem 'bootsnap',               '>= 1.1.0', require: false
gem 'cloudinary'
gem 'font-awesome5-rails'
gem 'pg', '0.20.0'
gem 'flatpickr'
gem 'delayed_job_active_record'
gem 'openpay'

group :development, :test do
  gem 'byebug',  '9.0.6', platform: :mri
end

group :development do
  gem 'web-console'
  gem 'listen'
  gem 'spring'
  gem 'spring-watcher-listen'
end

group :test do
  gem 'rails-controller-testing'
  gem 'minitest-reporters'
  gem 'guard'
  gem 'guard-minitest'
end

# group :production do
#  gem 'pg', '0.20.0'
# end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Please help, thank you.

I solved it. I just added the railties gem to the Gemfile, just below the rails gem, ie:

gem 'rails',                   '5.2.2'
gem 'railties',                '5.2.2'  # added this line

I don't know why it wasn't there already. Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM