neo4jrb / neo4j-rake_tasks

Rake tasks for managing Neo4j. Tasks allow for starting, stopping, and configuring
MIT License
13 stars 20 forks source link

neo4j:install does not work on windows #35

Open prakashmurthy opened 8 years ago

prakashmurthy commented 8 years ago

Re-posting this issue from stackoverflow over here.

Stack trace for the failure:

C:\blog>rake neo4j:install --trace
** Invoke neo4j:install (first_time)
** Execute neo4j:install
Install Neo4j (development environment)...
rake aborted!
ArgumentError: wrong number of arguments (1 for 0)
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/neo4j-rake_tasks-0.7.3/lib/neo4j/rake_tas
ks/windows_server_manager.rb:15:in `install'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/neo4j-rake_tasks-0.7.3/lib/neo4j/rake_tas
ks/neo4j_server.rake:34:in `block (2 levels) in <top (required)>'

The install command is being called with a args[:edition] parameter in neo4j_server.rake, while the windows_server_manager version of install method does not take any parameters.

deobald commented 4 years ago

I ran into this bug trying to set up our project (https://github.com/pariyatti/kosa) for a volunteer designer, who is using Windows at the moment. It would be vastly preferable to use the Rake tasks to set up, configure, and manage Neo4j... they've been a godsend on Linux.

Unfortunately, I don't have a Windows machine to test this with right now. Remote pairing, we did fix the wrong number of arguments issue, which was trivial. It's easy to pass the edition_string as a param to the call to super here:

https://github.com/neo4jrb/neo4j-rake_tasks/blob/b79b7c0cdb3ea690346c81cf00042b7c56f2b20a/lib/neo4j/rake_tasks/windows_server_manager.rb#L15-L16

After that, we had to change this line:

https://github.com/neo4jrb/neo4j-rake_tasks/blob/b79b7c0cdb3ea690346c81cf00042b7c56f2b20a/lib/neo4j/rake_tasks/server_manager.rb#L23

to: FileUtils.rm archive_path, force: true

...though I don't think that's the right solution. This got us past that point, but it then seems like the jar isn't being downloaded at all, since in this line:

https://github.com/neo4jrb/neo4j-rake_tasks/blob/b79b7c0cdb3ea690346c81cf00042b7c56f2b20a/lib/neo4j/rake_tasks/server_manager.rb#L285

Dir.glob(@path.join('lib/neo4j-kernel-*.jar')) is returning [] (empty array) and that file doesn't seem to exist at db/neo4j/development.

I'm on the side of a mountain with a mobile phone for internet so remote pair programming was too painful to actually bring this thing to a conclusion... but I think it's quite doable, and it would make the lives of your Windows users a thousand times better. :smile_cat: