升级到 Rails 5.2.2 时出现 Railties 兼容性问题
Railties compatibility issue while upgrading to Rails 5.2.2
我正在尝试将 Rails 应用程序从 Rails 5.2.0.rc2 更新到 Rails 5.2.2
到目前为止,我:
- 已删除gemfile.lock
- 删除了 gem 文件中大多数 gem 的版本号
- 已将 gem 文件中的 rails gem 版本升级到 5.2.2
当我 运行 bundle update 或 bundle install 时,我得到这个错误:
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)
如果我尝试 捆绑包更新 rails,我得到:
This Bundle hasn't been installed yet. Run `bundle install` to update and install the bundled gems.
这是我的 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]
请帮忙,谢谢。
我解决了。我刚刚将 railties gem 添加到 Gemfile,就在 rails gem 下方,即:
gem 'rails', '5.2.2'
gem 'railties', '5.2.2' # added this line
我不知道为什么它还没有出现。希望这有帮助。
我正在尝试将 Rails 应用程序从 Rails 5.2.0.rc2 更新到 Rails 5.2.2
到目前为止,我:
- 已删除gemfile.lock
- 删除了 gem 文件中大多数 gem 的版本号
- 已将 gem 文件中的 rails gem 版本升级到 5.2.2
当我 运行 bundle update 或 bundle install 时,我得到这个错误:
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)
如果我尝试 捆绑包更新 rails,我得到:
This Bundle hasn't been installed yet. Run `bundle install` to update and install the bundled gems.
这是我的 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]
请帮忙,谢谢。
我解决了。我刚刚将 railties gem 添加到 Gemfile,就在 rails gem 下方,即:
gem 'rails', '5.2.2'
gem 'railties', '5.2.2' # added this line
我不知道为什么它还没有出现。希望这有帮助。