Schneems
Schneems

Reputation: 15858

SQLite3::CantOpenException: unable to open database file while testing Ruby Gem

I'm running into this error message while testing a gem on travis:

SQLite3::CantOpenException: unable to open database file

I'm not even hitting the database in any of the tests, which is weird. Looks like the backtrace points a finger at fixtures, though I don't have any fixtures. Even if I did, the db is sqlite3...shouldn't it be able to be created on the fly?

You can see the build output here: http://travis-lite.com/schneems/maildown/jobs/9662299

Any help is appreciated.

Upvotes: 1

Views: 1700

Answers (1)

sarahhodne
sarahhodne

Reputation: 10114

Your test_helper.rb file includes this

# Load fixtures from the engine
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
  ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
end

Since you don't have fixtures, I'm guessing this is what's causing the trouble. You probably want to remove those lines?

You also don't have a /db folder in your project, try adding that to see if it fixes the build.

Upvotes: 7

Related Questions