I want to try using neo4j with Rails 3.2 app which is using Ruby MRI.
In this setup doc, bundling the app requires ActiveSupport 4, so, the question is whether it's possible to use the current setup (ActiveSupport 3.2.x) without using JRuby.
The preferred setup is to use server db, not embedded.
Thanks

- 27
- 1
- 7
1 Answers
That is a good question. I took a look through the git logs and I can't tell when it was switched from version 3 to version 4. It looks like it has been using 4 since version 3.0.0 of the neo4j
gem, though, which is when we started supporting server mode.
With regards to JRuby, even if it was an option for you, you would still need to use ActiveSupport so I don't think it would help.
I tried changing activesupport
, activemodel
, and railties
to version 3 in the gem and running the specs and came up with this:
/Users/brian/github/neo4jrb/neo4j/lib/neo4j/active_node/scope.rb:1:in `require': cannot load such file -- active_support/per_thread_registry (LoadError)
from /Users/brian/github/neo4jrb/neo4j/lib/neo4j/active_node/scope.rb:1:in `<top (required)>'
from /Users/brian/github/neo4jrb/neo4j/lib/neo4j.rb:89:in `require'
So it looks like there's at least one thing in ActiveSupport 4 that we depend on.
If this is really important, I would suggest forking the neo4j
repository and including it in your Gemfile like this:
gem 'neo4j', github: 'your_username/neo4j'
Then in your repository you can change the neo4j.gemspec
to use version 3 of the gems that I listed above. Then you'd need to fix the issue I mentioned above and any others that you might run across. Obviously this would make it difficult to keep up with the latest changes to the gem.
Generally I'm in favor of supporting older versions of Rails / ActiveSupport as much as we can. It looks like the upgrade to ActiveSupport 4 preceded me, but we'll definitely thinking thrice before depending on any features in 5.
Good luck!

- 10,746
- 1
- 22
- 34
-
Hi Brian and thanks a lot for the prompt and detailed answer. I think that soon enough I will be able to use AS 4 (in conjunction with Rails 4) so it will probably be non issue. In the meantime, as a workaround, I noticed we can use the ```neography``` gem so it will allow us to evaluate it in the meantime – Roy Zinn Dec 16 '15 at 07:39
-
You're welcome to use Neography, but I would suggest also checking out the `neo4j-core` gem. That's what the `neo4j` gem uses under the covers. It also depends on ActiveSupport, though it doesn't look like it specifies a version in the gemspec. The reason that it includes ActiveSupport is for `ActiveSupport::Notifications` and `HashWithIndifferentAccess`, both of which I'm pretty sure are in AS3 – Brian Underwood Dec 16 '15 at 08:52
-
thanks again for the comment, will definitely check it out – Roy Zinn Dec 17 '15 at 12:50