0

I have set up my rails app to use Neo4j using Neo4jRB which fine both in production and development. In testing however I get the error ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table:for each test, so it seems as though it still wants to use SQLite3.

I have set up my config/neo4j.yml so that it points to a running test database, however database.yml still points to SQLite3 and if I make changes to that then the error changes, so I'm guessing it has to do with that, but the neo4jrb documentation doesn't mention that you need to change database.yml.

Here's the test section of my neo4j.yml: test: type: http url: http://localhost:7575

database.yml is just the standard Rails generated file: default: &default adapter: sqlite3 pool: <%= ENV.fetch(RAILS_MAX_THREADS") { 5 } %> timeout: 5000 test: <<: *default database: db/test.sqlite3

Changing the adapter to for instance neo4jrb in database.yml removes the SQLite exceptions and gives me an adapter not found exception instead.

Simon Thordal
  • 893
  • 10
  • 28
  • What are the changes you have made to `config/neo4j.yml`? What are the changes you have attempted to make to `database.yml`, and what errors occur when you try that? – Rebecca Nelson Apr 14 '18 at 12:09

1 Answers1

0

As stated in the error, it is stemming from ActiveRecord not Neo4jrb:

ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table:

I'm assuming you have both Neo4jrb and ActiveRecord installed (which is allowed). When you are running your tests, ActiveRecord is not configured properly. If you don't want ActiveRecord installed, you should uninstall it. EIther way, this sounds like an ActiveRecord configuration problem, not a Neo4jrb configuration problem.

John
  • 9,249
  • 5
  • 44
  • 76