Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake aborted! ArgumentError : wrong number of arguments (1 for 0) while installing neo4j #1296

Closed
prashantkb opened this issue Sep 23, 2016 · 6 comments

Comments

@prashantkb
Copy link

when i try to install neo4js in windows command prompt with ruby on rails i m getting this error...

command : rake neo4j:install[community-latest]

Install Neo4j (Development Version)...
Rake Aborted!
ArgumentError : wrong number of arguments (1 for 0)

Ruby Version : 2.2.5
Rails Version : 5.0.0.1

This is the trace information

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:inblock (2 levels) in ' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:248:in call
'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:248:inbloc k in execute' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:243:in each
'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:243:inexec ute' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:187:in bloc
k in invoke_with_call_chain'
C:/Ruby22-x64/lib/ruby/2.2.0/monitor.rb:211:inmon_synchronize' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:180:in invo
ke_with_call_chain'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:173:ininvo ke' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:152:i n invoke_task'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:108:i
nblock (2 levels) in top_level' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:108:i n each'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:108:i
nblock in top_level' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:117:i n run_with_threads'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:102:i
ntop_level' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:80:in block in run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:i
nstandard_exception_handling' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:77:in run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/exe/rake:27:in' C:/Ruby22-x64/bin/rake:23:in load'
C:/Ruby22-x64/bin/rake:23:in' Tasks: TOP => neo4j:install

@ProGM
Copy link
Member

ProGM commented Sep 23, 2016

You're using a very old version of neo4j-rake_tasks, and I think it's broken. Have you tried to bundle update neo4j-rake_tasks?

@cheerfulstoic
Copy link
Contributor

I think that 0.7.3 is the latest version of neo4j-rake_tasks, unfortunately:

https://rubygems.org/gems/neo4j-rake_tasks

@prashantkb I haven't been able to test the gem on Windows for a while because of my computer situation, though I hope to be able to in the near future. If you're using Windows 10 you might be able to update to the Anniversary edition and use the new built-in bash shell:

http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/

But it looks like we didn't implement the install method to take an argument:

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

Which it's supposed to do (the argument is the edition_string):

https://github.com/neo4jrb/neo4j-rake_tasks/blob/master/lib/neo4j/rake_tasks/server_manager.rb

Another, probably easier option, is to simply download Neo4j via their website:

http://neo4j.com/download

The rake tasks are there to provide a way to manage Neo4j servers from the command line, but they aren't required

@prashantkb
Copy link
Author

Hello Sir,

as i m getting error while installing neo4j from command prompt its was giving error..

so as u suggested another option to download the neo4j from http://neo4j.com/download
i download it and installed on my computer and it started at http://localhost:7474

so its worked fine ...

after that i added These two configuration options in the railsproject/config/development.rb
config.neo4j.session_type = :server_db
config.neo4j.session_path = 'http://localhost:7474'

after that i generated the model

$ rails g model Asset title:string created_at:datetime updated_at:datetime

but its giving the error -

C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/railtie/config
uration.rb:95:in method_missing': undefined methodneo4j' for #<Rails::Applica
tion::Configuration:0x000000058ee5b8> (NoMethodError)
from C:/asset_portal/config/environments/development.rb:48:in block in <top (required)>' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/r ailtie.rb:209:ininstance_eval'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/r
ailtie.rb:209:in configure' from C:/asset_portal/config/environments/development.rb:1:in<top (requ
ired)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/ac
tive_support/dependencies.rb:293:in require' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/ac tive_support/dependencies.rb:293:inblock in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/ac
tive_support/dependencies.rb:259:in load_dependency' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/ac tive_support/dependencies.rb:293:inrequire'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/e
ngine.rb:600:in block (2 levels) in <class:Engine>' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/e ngine.rb:599:ineach'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/e
ngine.rb:599:in block in <class:Engine>' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/i nitializable.rb:30:ininstance_exec'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/i
nitializable.rb:30:in run' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/i nitializable.rb:55:inblock in run_initializers'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:226:in block in tsort_each' from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:348:inblock (2 levels) in e
ach_strongly_connected_component'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:420:in block (2 levels) in e ach_strongly_connected_component_from' from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:429:ineach_strongly_connect
ed_component_from'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:419:in block in each_strongl y_connected_component_from' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/i nitializable.rb:44:ineach'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/i
nitializable.rb:44:in tsort_each_child' from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:413:incall'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:413:in each_strongly_connect ed_component_from' from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:347:inblock in each_strongl
y_connected_component'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:345:in each' from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:345:incall'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:345:in each_strongly_connect ed_component' from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:224:intsort_each'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:203:in tsort_each' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/i nitializable.rb:54:inrun_initializers'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/a
pplication.rb:352:in initialize!' from C:/asset_portal/config/environment.rb:5:in<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/a
pplication.rb:328:in require' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/a pplication.rb:328:inrequire_environment!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/c
ommands/commands_tasks.rb:157:in require_application_and_environment!' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/c ommands/commands_tasks.rb:143:ingenerate_or_destroy'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/c
ommands/commands_tasks.rb:60:in generate' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/c ommands/commands_tasks.rb:49:inrun_command!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/c
ommands.rb:18:in <top (required)>' from bin/rails:4:inrequire'
from bin/rails:4:in `

'

@prashantkb
Copy link
Author

I Resolved the error by Adding

require 'neo4j/railtie'

in railsproject/config/application.rb file

@cheerfulstoic
Copy link
Contributor

I'm glad it got figured out! We've also got instructions for different sorts of setups if you run into anything else:

http://neo4jrb.readthedocs.io/en/7.1.x/Setup.html

Of course feel free to let us know if you still can't figure it out

@cheerfulstoic
Copy link
Contributor

Closing this issue in favor of neo4jrb/neo4j-rake_tasks#35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants