Yann
Yann

Reputation: 191

Issues with neo4j.rb, JRuby. Cannot start rails server

I am trying to create an application with JRuby, Rails and Neo4j. I tried installing neo4j and get it started with Rails 5.0.0, but I got several complaint regarding a missing (???) activesupport gem. Which is weird because the gem is listed when I run “gem list”. Well, I tried doing the same using Rails 4.2.6. After many temporary tweaks to eliminate some issues reported below, I finally got neo4j to start. However, I could not start the Rails server unless I commented out almost every line in confit/initializers/new_framework_defaults.rb. Here are the reported errors, and how I dealt with them. Is there a better solution for this, that will not imply enabling/disabling all this configuration methods?

Could please anyone suggest methods to go around/solve all these issues?

  1. gem install rails -v 4.2

  2. bundle exec rails new myApp -m http://neo4jrb.io/neo4j/neo4j.rb -O

  3. cd myApp && bundle exec rake neo4j:install[community-latest]

    • I had to disable "require "action_cable/engine"" in config/application.rb
  4. START NEO4j: bundle exec rake neo4j:start

    PROBLEM 1: NameError: uninitialized constant ActiveSupport::EventedFileUpdateChecker

    • I disabled the line config.file_watcher = ActiveSupport::EventedFileUpdateChecker
      in config/environments/development.rb. Then re-ran bundle exec rake neo4j:start.

    PROBLEM 2: NoMethodError: undefined method `to_time_preserves_timezone=' for ActiveSupport:Module.

    • I commented out the line ActiveSupport.to_time_preserves_timezone = true
      in config/initializers/new_framework_defaults.rb:15. Then re-ran bundle exec rake neo4j:start.

    PROBLEM 3: NoMethodError: undefined method 'halt_callback_chains_on_return_false=' for ActiveSupport:Module

    • I commented out the line ActiveSupport.halt_callback_chains_on_return_false = false
      in config/initializers/new_framework_defaults.rb. Then re-ran bundle exec rake neo4j:start.

    PROBLEM 4: NoMethodError: undefined method `perform_caching=' for ActionMailer::Base:Class

    • I then commented out the line config.action_mailer.perform_caching
      in config/application.rb: require "action_mailer/railtie"
    • I also commented out the following lines in config/environments/development config.action_mailer.raise_delivery_errors = false
      config.action_mailer.perform_caching = false

Then re-ran bundle exec rake neo4j:start:

FINALLY, IT WORKED

5) Starting be rails s

PROBLEM: "Rack app error: #< RuntimeError: Invalid option key: per_form_csrf_tokens=>"

I set Rails.application.config.action_controller.per_form_csrf_tokens = false
in config/initializers/new_framework_defaults.rb. However, it did not help. Below is the full error message:

I had to comment out the line Rails.application.config.action_controller.forgery_protection_origin_check = true in config/initializers/new_framework_defaults.rb

Upvotes: 1

Views: 362

Answers (1)

Brian Underwood
Brian Underwood

Reputation: 10856

Sorry, I think we should have a note in our README about this. Could you try the rails5 branch?

gem 'neo4j', github: 'neo4jrb/neo4j', branch: 'rails5'

Upvotes: 0

Related Questions