升级到Rails 5.2.2时出现Railties兼容性问题

时间:2019-02-22 16:31:19

标签: ruby-on-rails ruby-on-rails-5.2

我正在尝试将Rails应用程序从Rails 5.2.0.rc2更新到Rails 5.2.2

到目前为止,我:

  • 已删除gemfile.lock
  • 从gem文件中的大多数gem中删除了版本号
  • gem文件中的rails gem升级到5.2.2

当我运行捆绑更新捆绑安装时,出现此错误:

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)

如果我尝试捆绑更新导轨,则会得到:

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

这是我的宝石文件:

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]

请帮助,谢谢。

1 个答案:

答案 0 :(得分:0)

我解决了。我刚刚将railties宝石添加到Gemfile中,就在rails宝石下方,即:

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

我不知道为什么它不存在。希望这会有所帮助。