1

我有一个带有两个节点的小型 Neo4j 数据库:AuthorBook. 关系是一位或多位作者撰写的书籍。从 rails 控制台我正在加载一个Author节点,我得到了一个结果

a = Neo4j::Node.load(36) 
=> #<Author name: "Levi">

下一个是给我和错误

a.outgoing(:BOOKS)
NoMethodError: undefined method `outgoing' for #<Author name: "Levi">
    from /Users/levidamian/.rvm/gems/ruby-2.1.5/gems/activemodel-4.1.8/lib/active_model/attribute_methods.rb:435:in `method_missing'
    from (irb):7

这里有什么问题?

编辑:

Neo4j 宝石:

neo4j (4.1.1)
neo4j-core (4.0.1, 4.0.0)
neo4j-cypher (1.0.4)

宝石文件:

gem 'neo4j' 
gem 'neo4j-cypher'
gem 'thin'
gem 'rails', '4.1.8'
gem 'unicorn'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
group :production do 
  gem 'rails_12factor'
end
4

1 回答 1

1

a.outgoing(:BOOKS) looks like a method from the neo4j-cypher gem, which was never part of the released versions of Neo4j or Neo4j-core. You should remove this gem from your project and if you came across a resource somewhere telling you to use it, let them know that they have outdated information.

If you're using Neo4j::ActiveNode and models, see the documentation at https://github.com/neo4jrb/neo4j/wiki. If you just want basic Neo4j connectivity and methods, use Neo4j-core and see https://github.com/neo4jrb/neo4j-core.

于 2015-01-27T20:51:38.287 回答