After upgrading a Rails app to Rails 5, running RSpec tests gives me the following error:
rails aborted!
ActiveRecord::NoEnvironmentInSchemaError:
Environm
All of the above answers are correct, however, if you're in a more unique project such as developing a rails engine with a concept of a schema (hacky, I know) and your migration fails for some reason, you can re-run it without the check that throws this exception. Example:
rake environment db:{drop,create,migrate} DISABLE_DATABASE_ENVIRONMENT_CHECK=1