Why am I asked to run 'rake db:migrate RAILS_ENV=test'?
Solution 1:
As of Rails 4.1, the rake db:test:*
tasks are deprecated. Instead, your (test|spec)_helper.rb
should include:
ActiveRecord::Migration.maintain_test_schema!
This means that your test database will get the correct schema every time your tests run, whether you run them from a Rake task or not.
Solution 2:
Looks like rake test:prepare
works, not sure what db:test:prepare
now does.
Solution 3:
You can also try
rake db:migrate RAILS_ENV=test
which works as
db:test:prepare
does:)