Rails 5 saves environment in the DB
Rails 5 added an internal metadata table that saves the rails environment to the database.
This metadata table can lead to an
ActiveRecord::EnvironmentMismatchError when restoring a staging/production database to the development environment.
To fix the error, you can run