Ruby on Rails Running migrations in different environments


Example

To run migrations in the test environment, run this shell command:

rake db:migrate RAILS_ENV=test
5.0

Starting in Rails 5.0, you can use rails instead of rake:

rails db:migrate RAILS_ENV=test