activegraph icon indicating copy to clipboard operation
activegraph copied to clipboard

rake install throws NoMethodError: undefined method `[]' for nil:NilClass

Open jordan-thenumber opened this issue 5 years ago • 1 comments

Additional information which could be helpful if relevant to your issue:

Code example (inline, gist, or repo)

rake neo4j:install[community-latest,dev] --trace

Runtime information:

Neo4j database version: neo4j gem version: 7.0.13 neo4j-core gem version: 6.1.4

The error is occuring in server_manager.rb line 269:

  def server_version
    kernel_jar_path = Dir.glob(@path.join('lib/neo4j-kernel-*.jar'))[0]
    kernel_jar_path.match(/neo4j-kernel-([\d\.]+)\.jar$/)[1]
  end

The second line assumes that the kernel_jar_path is neo4j-kernel-{version}.jar when, in my case, was actually neo4j-kernel-api-{version}.jar.

The call to match returns nil and throws an error when looking for the [1] index. A solution to this would be to build a better regex that takes this into account. I'm not a regex expert so I wouldn't presume to provide an example but I feel this would be fairly trivial to someone with decent competency in regex string matching.

jordan-thenumber avatar Jan 23 '19 21:01 jordan-thenumber

have you found a solution to this? I am having the same issue.

rake neo4j:install[community-latest] --trace
** Invoke neo4j:install (first_time)
** Execute neo4j:install
Install Neo4j (development environment)...
Retrieving latest version...
Latest version is: 3.4.1
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass

simonahad avatar Dec 31 '19 13:12 simonahad