将 neo4j gem 用于非 rails 的错误(仅 ruby)

errors using neo4j gem for non-rails (ruby-only)

来自文档:http://neo4jrb.readthedocs.io/en/8.0.x/Setup.html

neo4j_adaptor = Neo4j::Core::CypherSession::Adaptors::HTTP.new('http://user:pass@host:7474') Neo4j::ActiveBase.on_establish_session { Neo4j::Core::CypherSession.new(neo4j_adaptor) }

我得到:

NameError: uninitialized constant Neo4j::Core::CypherSession

为了修复,我添加了(上面没有记录):

require 'neo4j/core/cypher_session/adaptors/http'

错误变化(第一行有效):

Neo4j::ActiveBase.on_establish_session { Neo4j::Core::CypherSession.new(neo4j_adaptor) } NameError: uninitialized constant Neo4j::ActiveBase

有没有更好的地方可以了解如何设置使用基于 heroku 的 grapheneDB?在对设置进行剪切和粘贴时,我一直遇到未记录的错误。

感谢您指出遗漏的 require。我刚刚添加了它(如果您注意到其他任何内容,也可以随时单击顶部的 "Edit on GitHub" 开始拉取请求)

你做过require "neo4j"吗?那应该引入 ActiveBase 和所有 ActiveNode / ActiveRel 的东西。如果可行,我也可以将其添加到文档中