sqlite3, camping, and sessions

If you use Camping::Session, this could be useful to you.


I was tearing my hair out because all of a sudden after I deleted my ~/.camping.db, my camping app completely failed despite the .create method that had worked perfectly well before. The error

ActiveRecord::StatementInvalid ActiveRecord::StatementInvalid:

is identical to the one you get if you try to use the sqlite3-ruby gem without swig bindings installed.

So, I tried every possible combination of installs, uninstalls, library paths, and even looked in the sqlite3-ruby sources, where it seemed that some table was empty when it wasn’t supposed to be.


It wasn’t until I switched to MySQL that I really figured out the problem.

No such table 'sessions'.

If you are using Camping::Session, you need the line Camping::Models::Session.create_schema in your .create method. I had run the camping examples before, and this had created the sessions table in my ~/.camping.db. But when I reset the database that table got destroyed, never to return.


sqlite3-ruby’s error reporting is less than awesome.