rails7-startkit
rails7-startkit copied to clipboard
database that was last run in `development`
rspec -f documentation
ActiveRecord::EnvironmentMismatchError: You are attempting to modify a database that was last run in `development` environment.
You are running in `test` environment. If you are sure you want to continue, first set the environment using:
bin/rails db:environment:set RAILS_ENV=test
Tasks: TOP => db:test:load => db:test:purge => db:check_protected_environments
(See full trace by running task with --trace)

Hello @the-teacher if you are using windows run this command => rails db:environment:set RAILS_ENV=test
, and if you are using a different OS you can run this command bin/rails db:environment:set RAILS_ENV=test
This problem only shows when you are testing, Ruby on Rails has different databases for development, testing, and production.