我試圖將我的 Rails 應用程式從 Rails 6.1 更新到 7.0.4。
當我在我的 gemfile 上更新 rails 和 ruby?? 后嘗試捆綁安裝時。我在我的 gemfile 上找不到任何可以更改的 gem 版本。
這是我的寶石檔案:
ruby "3.1.2"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem "rails", "~> 7.0.4"
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.1'
gem 'activerecord', '>= 7.0.4'
gem 'actionpack', '>= 7.0.4'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false
gem 'devise'
gem 'pundit'
gem 'simple_token_authentication'
gem 'autoprefixer-rails'
gem 'font-awesome-sass', '~> 6.1'
gem 'simple_form'
# Charts
gem "chartkick"
# Generateur de PDF
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'wkhtmltopdf-heroku', '2.12.6.0'
# Editeur de texte
gem 'ckeditor', github: 'galetahub/ckeditor'
gem "mini_magick"
gem "select2-rails"
gem 'select2_simple_form', github: 'lndl/select2_simple_form', tag: '0.7.3'
gem 'sidekiq'
gem 'sidekiq-failures', '~> 1.0'
# Cloud Storage
gem "aws-sdk-s3", require: false
gem "down"
gem "image_processing", ">= 1.2"
# transform file via zip
gem 'rubyzip', '>= 1.0.0'
gem 'zip-zip'
# XML reader
gem 'nokogiri', '~> 1.6', '>= 1.6.6.2'
group :development, :test do
gem 'pry-byebug'
gem 'pry-rails'
gem 'dotenv-rails'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 4.1.0'
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem 'rack-mini-profiler', '~> 2.0'
gem 'listen', '~> 3.3'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 3.26'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
這是我總是得到的錯誤:
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails (~> 7.0.4) was resolved to 7.0.4, which depends on
actionpack (= 7.0.4)
simple_token_authentication was resolved to 1.13.0, which depends on
actionpack (< 5, >= 3.2.6)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
rails (~> 7.0.4) was resolved to 7.0.4, which depends on
activerecord (= 7.0.4)
simple_token_authentication was resolved to 1.5.2, which depends on
activerecord (< 5, >= 3.2.6)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 7.0.4)
simple_token_authentication was resolved to 1.0.0.pre.beta.2, which depends on
rails (~> 4.0.0)
我試圖通過查看此處顯示的依賴項來重新安裝捆綁包和每個 gem:https ://rubygems.org/gems/rails/versions/7.0.4/dependencies 。
經過多次研究,我找不到解決問題的方法,每次嘗試都會導致前面顯示的依賴關系錯誤。
uj5u.com熱心網友回復:
Actionpack并activerecord直接與rails捆綁在一起,因此它會同時更新。
simple_token_authentication依賴于早期版本的 rails,因此您也需要對其進行更新。
考慮到您說您是從 6.1 更新的,它似乎依賴于 <5,這很奇怪,但我會假設您的包之前運行過。
但是,看起來您使用的是最新版本,因此您的選擇是查找不同的 gem 或等待 gem 更新。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/531223.html
標籤:轨道上的红宝石红宝石
