Created
June 20, 2011 16:15
-
-
Save thoughtpunch/1035912 to your computer and use it in GitHub Desktop.
jruby + neo4j gem: running example from http://wiki.neo4j.org/content/Getting_Started_With_Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1.TEST.RB FROM http://wiki.neo4j.org/content/Getting_Started_With_Ruby | |
#require "rubygems" | |
#require 'neo4j' | |
#create one node | |
#Neo4j::Transaction.run do | |
# #create a node and on property | |
# node = Neo4j::Node.new :age => 21 | |
# | |
# #update the node with another property | |
# node[:name] = 'Anuj' | |
# | |
# #make a relationship to the reference node of type "dummy" | |
# node.add_rel(:MY_TYPE, Neo4j.ref_node) | |
# | |
# #add some properties to the relationship | |
# node.rels.outgoing.first.update(:weight => '1') | |
#end | |
# 2.CONSOLE OUTPUT | |
dan@itsa-dlb9-ol1:~$ jruby test.rb | |
I, [2011-06-20T12:12:19.311000 #12573] INFO -- : Enable remote shell at port port=9332 | |
I, [2011-06-20T12:12:19.342000 #12573] INFO -- : Starting local Neo4j using db /home/dan/db | |
NoMethodError: undefined method `add_rel' for #<#<Class:0x1018a62f6>:0x74c144> | |
__file__ at test.rb:13 | |
run at /usr/local/lib/jruby-1.6.2/lib/ruby/gems/1.8/gems/neo4j-1.1.2-java/lib/neo4j/transaction.rb:57 | |
(root) at test.rb:5 | |
dan@itsa-dlb9-ol1:~$ |
It seems that the add_rel method does not exist. Try with node.outgoing(:your_relationship) << another_node
I know it's much later, but is there a solution to this? Or is this the solution: node.outgoing(:your_relationship) << another_node
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running the test.rb neo4j example from http://wiki.neo4j.org/content/Getting_Started_With_Ruby
Not sure why I'm getting a "undefined method 'add_rel'" error.
~Dan