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'
...
を見つけしかし、確かにそれがデータベースにありますように思えることができませんでした:私はちょうど私のすべての宝石を更新しましたのActiveRecord :: StatementInvalid:テーブル「テーブル名」
db: sqlite3 development.sqlite3
SQLite version 3.2.8
sqlite> select count(*) from author;
168600
など間違って何が起こっています?
これは記事を探していますが、著者を確認しています。 –
'Article'モデルでは、 'articles'テーブルを探すべきです。どこでも 'set_table_name'を呼び出しましたか?そしてあなたのコンソールの例は 'author'テーブル(おそらく 'articles'であるはずです)にあります。 –
Ooops、それはちょうど愚かなタイプミスでした。私はアーティクルのSQLで正の数を持ち、Author.count()でコンソールに同じエラーがあります。 – hadley