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

uninitialized constant Neo4j when using neo4j-rspec #27

Open
suriyalakshmip opened this issue Oct 7, 2018 · 2 comments
Open

uninitialized constant Neo4j when using neo4j-rspec #27

suriyalakshmip opened this issue Oct 7, 2018 · 2 comments

Comments

@suriyalakshmip
Copy link

suriyalakshmip commented Oct 7, 2018

Failure/Error: config.include Neo4j::RSpec::Matchers

NameError:
uninitialized constant Neo4j
./spec/spec_helper.rb:21:in block in <top (required)>' ./spec/spec_helper.rb:20:in <top (required)>'
./spec/rails_helper.rb:2:in require' ./spec/rails_helper.rb:2:in <top (required)>'

@wjdhamilton
Copy link

I have the same problem. Created a new Rails project as per instructions from neo4jrb and neo4j-rspec READMEs. Upon calling rake neo4j:migrate RAILS_ENV=test, I get the following error:

NameError: uninitialized constant Neo4j::RSpec::Matchers                                                              
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `block in load_missing_constant'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `rescue in load_missing_constant'   
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:in `load_missing_constant'
/Users/jameshamilton/sites/rspec-neo4j-error/config/environments/test.rb:43:in `block in <main>'                                                       
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/railtie.rb:216:in `instance_eval'                          
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/railtie.rb:216:in `configure'               
/Users/jameshamilton/sites/rspec-neo4j-error/config/environments/test.rb:1:in `<main>'                                     
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'                       
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'               
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/engine.rb:602:in `block (2 levels) in <class:Engine>'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/engine.rb:601:in `each'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/engine.rb:601:in `block in <class:Engine>'                 
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'                                                
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `run'                              
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'                           
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:50:in `each'                              
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'            
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/application.rb:361:in `initialize!'       
/Users/jameshamilton/sites/rspec-neo4j-error/config/environment.rb:5:in `<main>'                                
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/application.rb:337:in `require_environment!'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'                                 
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/neo4j-9.2.4/lib/neo4j/tasks/migration.rake:45:in `block (2 levels) in <main>'                       
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'                                                                    
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'                                                                   
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'  

Caused by:                                                                                                            
NameError: uninitialized constant Neo4j::RSpec::Matchers                                                                   
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:60:in `block in load_missing_constant'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'              
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:in `load_missing_constant'
/Users/jameshamilton/sites/rspec-neo4j-error/config/environments/test.rb:43:in `block in <main>'                                                       
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/railtie.rb:216:in `instance_eval'                          
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/railtie.rb:216:in `configure'                        
/Users/jameshamilton/sites/rspec-neo4j-error/config/environments/test.rb:1:in `<main>'           
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/engine.rb:602:in `block (2 levels) in <class:Engine>'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/engine.rb:601:in `each'                  
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/engine.rb:601:in `block in <class:Engine>'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `run'                               
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'                                    
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:50:in `each'                             
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'                                    
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'                  
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/application.rb:361:in `initialize!'         
/Users/jameshamilton/sites/rspec-neo4j-error/config/environment.rb:5:in `<main>'                                                                            
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'              
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'               
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/application.rb:337:in `require_environment!'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/railties-5.2.2.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/neo4j-9.2.4/lib/neo4j/tasks/migration.rake:45:in `block (2 levels) in <main>'                                
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'                                                                    
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'                                                                   
/Users/jameshamilton/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'                                                                     
Tasks: TOP => neo4j:migrate:all => environment                                                                                       
(See full trace by running task with --trace)                 

I have set up a repository that replicates the problem at my end:

https://github.com/wjdhamilton/rspec-neo4j-error

Thanks for your help

@petrosp
Copy link

petrosp commented Jan 25, 2020

Perhaps this may prove helpful: #15 (comment)

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