Why am I asked to run 'rake db:migrate RAILS_ENV=test'?

后端 未结 6 1699
逝去的感伤
逝去的感伤 2020-12-07 10:58

On Rails 4.0.0.rc1, Ruby 2.0.0, after I run a migration, I see the following error when I try to run a test through rspec:

/Users/peeja/.

6条回答
  •  囚心锁ツ
    2020-12-07 11:44

    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.

提交回复
热议问题