3

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

4 Answers 4

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

just as a note : the "in-memory" fix is also available as a plugin nubyonrails.com/articles/2006/06/01/… and github.com/rsl/memory_test_fix/tree/master
Link is dead. Here's the lastest from the wayback machine
0

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?

Comments

0

I got this error when running a test with the last statement being a click on a form submit. Once I did an assertion or should test, the test closed properly, and I didn't have to rerun the rake db:test:prepare

Comments

0

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 :-)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.