我正在尝试使用ruby 3和rails 7创建新的应用程序,在启动服务器时得到这个错误。
这是我的Gemfile
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.0.0"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 6.0.4.4"
# Use sqlite3 as the database for Active Record
gem "pg"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem "jbuilder"
# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem "rack-cors"
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
end
group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end
gem 'devise'
gem 'cssbundling-rails'
gem 'mini_magick', '>= 4.9.5'
gem 'carrierwave', '~> 0.9'
gem 'bootstrap-sass','~> 2.3.2'
# gem 'activeadmin'
gem 'sass-rails'我试图复制我的旧项目,它是建立在ruby 2和rails 7之上的。
发布于 2022-03-16 15:56:40
如果您通过删除您的gemfile.lock,然后卸载此版本的6.0.4.4来更改您的use文件版本,错误路径显示我们正在尝试使用这个旧版本。
gem 'rails', '~> 7.0', '>= 7.0.2.3' # Gemfilegem uninstall rails
gem uninstall railties# for example
gem install rails -v 7.0.2.3
# or only
bundle确保..。
config.load_defaults 7.0 # application.rb
class ... < ActiveRecord::Migration[7.0] # db/migrate/*.rb发布于 2022-09-05 03:16:26
请确保在\config\application.rb文件中提到了正确的rails版本
您想使用的config.load_defaults rails_version
https://stackoverflow.com/questions/71045663
复制相似问题