Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 seems like it's there in the database:

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

I've just updated all my gems, etc. What's going wrong?

like image 897
hadley Avatar asked Mar 13 '09 21:03

hadley


1 Answers

This seems to be caused by a bug in ActiveRecord, http://rails.lighthouseapp.com/projects/8994/tickets/99-sqlite-connection-failing. Monkey-patching the file as described in that link fixed the problem.

like image 163
hadley Avatar answered Oct 10 '22 08:10

hadley