When I ran `bundle exec rake test:prepare` it errored out, but `bundle exec rake db:test:prepare` goes through fine with warning. What's going on?

前端 未结 1 1553
慢半拍i
慢半拍i 2020-12-05 05:04

So according to this link one is a shortcut wrapper (so I\'m guessing they\'re the same).

When I ran bundle exec rake db:test:prepare, I get this error:

相关标签:
1条回答
  • 2020-12-05 05:56

    In Rails 4.1+, they deprecated db:test:prepare with that message. You can now just use:

    ActiveRecord::Migration.maintain_test_schema!

    in spec_helper.rb (or similar files if you're not using RSpec). That will automatically keep your test database in sync with your schema. Because of this 'automatic' method, db:test:prepare is no longer needed in most cases.

    If you need to do it manually for some reason, you can still use

    rake db:schema:load RAILS_ENV=test

    0 讨论(0)
提交回复
热议问题