Closed BenMorganIO closed 9 years ago
The error:
Neography::BadInputException - javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method out() on null object:
Is telling us that NeoId created a gremlin script that did a traversal node.out() but the node in question is null. So enable logging to try to capture the gremlin script.
Set config.log_enabled = true
see https://github.com/maxdemarzi/neography/wiki/Configuration-and-initialization for details
Within 01_neoid.rb
this is what I have done:
require('neography') unless defined?(Neography)
ENV["NEO4J_URL"] ||= "http://localhost:7474"
uri = URI.parse(ENV["NEO4J_URL"])
$neo = Neography::Rest.new(uri.to_s)
Neography.configure do |config|
config.server = uri.host
config.port = uri.port
if uri.user && uri.password
config.authentication = 'basic'
config.username = uri.user
config.password = uri.password
end
config.log_file = "log/neography.log"
config.gremlin_path = "http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script"
config.log_enabled = true
end
Neoid.db = $neo
Neoid.configure do |c|
c.enable_subrefs = true
end
I can't get a log/neography.log
to appear and there's nothing new appearing in the stack traces. I'll keep tinkering.
This is what I was doing:
I was logging in as a user on my application. I have devise installed. This was the user model:
class User < ActiveRecord::Base
include Neoid::Node
neoidable do |c|
c.field :email
end
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:confirmable, :lockable, :timeoutable
include Gravtastic
gravtastic
validates_presence_of :first_name, :last_name
def full_name
first_name + ' ' + last_name
end
def member_since
created_at.strftime('%B %Y')
end
end
When I remove the neoidable
block, it works and log/neography.log
appears.
Neoid.configure do |c|
c.enable_subrefs = false end
I'm making progress. Thanks @maxdemarzi. My next error is:
NoMethodError: undefined method `dump' for #<Excon::Response:0x007ff3af465280>
from /Users/benmorgan/.rvm/gems/ruby-2.1.2/gems/neography-1.5.1/lib/neography/connection.rb:216:in `handle_4xx_500_response'
I'll hunt around and get to the bottom of this. I want to see more Rails projects using Neoid/Neography/Neo4j. Will post if it is out of my limits.
Not sure if this was me, the gremlin plugin, or neography, but I'm currently receiving this error while using neoid:
The stack trace I currently have is not too helpful. I will be cross posting this issue on Neography and Neoid to help find the source of this error.
Expected Result: My web page loads in Rails. Given Result: I am given this error.
I apologize for the lack of information, but I'm not too sure what's caused this.