views:

554

answers:

3

Hello all, I seem to be getting a strange error when I run my tests in rails, they are all failing for the same reason and none of the online documentation seems particularly helpful in regards to this particular error:

SQLite3::SQLException: cannot rollback - no transaction is active

This error is crippling my ability to test my application and seems to have appeared suddenly. I have the latest version of sqlite3 (3.6.2), the latest sqlite3-ruby (1.2.4) gem and the latest rails (2.1.1). Thanks in advance for any help.

+1  A: 

Check http://dev.rubyonrails.org/ticket/4403 which shows a workaround. Could that be the problem you are encountering?

David Medinets
just as a note : the "in-memory" fix is also available as a plugin http://nubyonrails.com/articles/2006/06/01/san-francisco-sqlite3-memory-tests-asteroidsandhttp://github.com/rsl/memory_test_fix/tree/master
Jean
A: 

I had this problem once but with MySQL. Turned out I hadn't created the test database. Doh! Rails and sqlite creates them automatically I believe (at least it does in windows).

Are trying to do in memory testing? If not does the test database exist?

srboisvert
A: 

Hey guys, thanks for the help, I actually ended up just deleting the rails folder and checking back out the last working copy from version control. I've made the identical changes and this problem hasn't reappeared, so either I messed up or rails had some sort of hiccup. Thankfully I had version control :-)

Eric Scrivner