gpt4 book ai didi

ruby-on-rails - ActiveRecord::StatementInvalid:找不到表

转载 作者:行者123 更新时间:2023-12-03 11:45:22 25 4
gpt4 key购买 nike

我正在尝试运行刚刚有的users_test.rb文件

test "the truth" do
assert true
end

我确实有一个喜欢表,但仍然收到此错误。为什么这样?
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
➜ channelappnew rake db:test:clone
➜ channelappnew rake db:test:clone_structure
➜ channelappnew rake db:migrate
➜ channelappnew rake db:test:load
➜ channelappnew rake db:test:prepare
➜ channelappnew rake db:test:purge
➜ channelappnew ruby -Itest test/unit/user_test.rb
Loaded suite test/unit/user_test
Started
E

Error:
test_the_truth(UserTest):
ActiveRecord::StatementInvalid: Could not find table 'likes'




Finished in 0.058371 seconds.

1 tests, 0 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
0% passed

17.13 tests/s, 0.00 assertions/s

谢谢!

最佳答案

测试前做rake db:test:prepare

关于ruby-on-rails - ActiveRecord::StatementInvalid:找不到表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7617760/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com