neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.4k stars 276 forks source link

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

Open jordan-thenumber opened 5 years ago

jordan-thenumber commented 5 years ago

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.

simonahad commented 4 years ago

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