gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 06:26:43 25 4
gpt4 key购买 nike

cis.statbib.org: script/console 
Loading development environment (Rails 2.2.2)
Article.founc>> Article.count()
ActiveRecord::StatementInvalid: Could not find table 'article'
from /home/hadley/web/cis.statbib.org/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure'
from /home/hadley/web/cis.statbib.org/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb:39:in `returning'
...

但它看起来确实存在于数据库中:

db: sqlite3 development.sqlite3 
SQLite version 3.2.8
sqlite> select count(*) from author;
168600

我刚刚更新了我所有的 gem 等。出了什么问题?

最佳答案

这似乎是由 ActiveRecord 中的错误引起的,http://rails.lighthouseapp.com/projects/8994/tickets/99-sqlite-connection-failing .按照该链接中的说明通过猴子修补文件解决了该问题。

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

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