Ruby on Rails: Migrations and Environments

Problem:

You want to migrate a target environment other than development.

Solution:

For production:

>rake environment RAILS_ENV=production migrate

For test:

>rake environment RAILS_ENV=test migrate