ActiveRecord :: StatementInvalid: Could not find table 'tablename'

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' ... 

But it certainly looks like what the database has:

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

I just updated all my gems, etc. Something went wrong?

+6
ruby-on-rails sqlite
source share
2 answers

This is apparently caused by a bug in ActiveRecord, http://rails.lighthouseapp.com/projects/8994/tickets/99-sqlite-connection-failing . Clearing the file, as described in this link, fixed the problem.

+2
source share

As Sarah May pointed out in the comments, you manually check the "author", not the "article".

However, something else may be here. Did you intentionally set the table name in the "article" in your model? By default, this should look for a table of โ€œarticlesโ€ (plural), so I suspect there is more code that we donโ€™t see that might cause problems.

0
source share

All Articles