Released 2.2.0 and the new neo4j-cypher gem

277 views
Skip to first unread message

Andreas Ronge

unread,
Oct 4, 2012, 4:57:25 AM10/4/12
to neo...@googlegroups.com
Hi

I've released version 2.2.0 of neo4j-core, neo4j-wrapper and the neo4j
Ruby gems.
This release contains a new gem, the neo4j-cypher gem which also can
be used from the neography and none JRuby platforms.
I've also released the jars for the new Neo4j 1.8 (neo4j-community,
neo4j-advanced and neo4j-enterprise).

Blogs
====

Neo4j Ruby DSL -
http://www.jayway.com/2012/10/04/the-cypher-ruby-dsl-for-the-neo4j-graph-database/
Neo4j 1.8 - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


New Feature
=========

One cool thing with the 2.2.0 release is that if you don't declare a
lucene index it will try to find it using cypher instead.

jruby-1.7.0.RC1 :002 > require 'neo4j'
=> true
jruby-1.7.0.RC1 :003 > class Person < Neo4j::Rails::Model
jruby-1.7.0.RC1 :004?> property :name, :default => '' # Notice, no
lucene index !!
jruby-1.7.0.RC1 :005?> end
=> [:name]
jruby-1.7.0.RC1 :006 > Person.create(:name => 'andreas')
I, [2012-10-04T09:41:53.710000 #1750] INFO -- : Starting local Neo4j ...
ruby-1.7.0.RC1 :008 > Person.find(:name => 'andreas')
=> #<Person:0xd8b9fac ...


CHANGELOGS
===========

Changelog for ruby neo4j gem:

== 2.2.0 / 2012-10-02
* Fix of neo4j-core configuration issue using boolean values #218
* Fixed RSpec issue on JRuby 1.7.x #217
* Aliased has_many to has_n, #183

== 2.2.0.rc1 / 2012-09-21
* Use the neo4j-cypher gem
* Better support for Orm Adapter, #212
* Use Cypher query when finder method does not have a lucene index, #210

Changelog for neo4j-core:

== 2.2.0 / 2012-10-02
* Use 1.0.0 of neo4j-cypher
* Fix of Neo4j::Config issue using boolean values, andreasronge/neo4j#218
* The []= operator checks that the value is a valid Neo4j value #16

== 2.2.0.rc1 / 2012-09-21
* Deleted, refactored, improved and moved cypher stuff to neo4j-cypher gem
* Add neo4j statistics, #15

For more info, check the github issues.

Cheers
Andreas

Andreas Ronge

unread,
Oct 4, 2012, 5:00:23 AM10/4/12
to neo...@googlegroups.com

arikan

unread,
Nov 4, 2012, 5:07:28 PM11/4/12
to neo...@googlegroups.com
Hi Andreas, thanks for the update. 

Upgraded to neo4j (2.2.0) but getting error with devise-neo4j

gem "neo4j", ">= 2.2.0"
gem 'devise-neo4j',  :git => 'git://github.com/andreasronge/devise-neo4j.git'

bundle is updated successfully, but it throws the error below, what could be wrong here?

>> bundle exec rails g devise:install --orm=neo4j
NameError: uninitialized constant Devise::Schema

>> rails s 
NameError: uninitialized constant Devise::Schema

Thanks,
burak

arikan

unread,
Nov 5, 2012, 2:46:56 AM11/5/12
to neo...@googlegroups.com
I am on jruby 1.7.0, also tried devise-neo4j with neo4j 2.0.0 and other versions of Rails (3.2.8, 3.2.7, 3.1.7) getting the same NameError: uninitialized constant Devise::Schema 

reported the issue here: https://github.com/andreasronge/neo4j/issues/135

Any help appreciated.

Thanks,
burak

Toni

unread,
Nov 5, 2012, 5:18:16 AM11/5/12
to neo...@googlegroups.com
Guys,

the devise-neo4j code was last modified on Sep 25, 2011, so don't expect it to work after so many changes happened in Neo4j.

Regards,
Antonio

Andreas Ronge

unread,
Nov 5, 2012, 5:56:39 AM11/5/12
to neo...@googlegroups.com
Hi

I think it should work on the old devise < version 2.0.
Btw, according to this
(https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0)
the devise 2.0 is a small release with only few changes.

Cheers
Andreas
> --
> You received this message because you are subscribed to the Google Groups
> "neo4jrb" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/neo4jrb/-/u8f1lfm70ZIJ.
>
> To post to this group, send email to neo...@googlegroups.com.
> To unsubscribe from this group, send email to
> neo4jrb+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/neo4jrb?hl=en.

Chris Fitzpatrick

unread,
Nov 5, 2012, 6:51:49 AM11/5/12
to neo...@googlegroups.com

I have a folk of these at https://github.com/cfitz/devise-neo4j that I am using which should work with both the new version of neo4jrb and devise 2.0.4.  However, I haven't added any tests to the gem since I am testing this in the application....maybe in a couple of days I'll add the tests and put in a proper pull request....let me know if you have any questions...

arikan

unread,
Nov 5, 2012, 7:37:29 AM11/5/12
to neo...@googlegroups.com
Hi Chris, 

I tried your devise-neo4j, it has the following dependency mismatch with neo4j 2.0, is it a quick fix?

devise-neo4j (>= 0) java depends on
      orm_adapter (~> 0.0.3) java

    neo4j (= 2.0.0) java depends on
      orm_adapter (0.4.0)

burak

Chris Fitzpatrick

unread,
Nov 5, 2012, 7:55:35 AM11/5/12
to neo...@googlegroups.com
Hm. That's odd, because i think neo4j's gemspec has orm_adapter at 0.0.3 as well....is it possible to paste in your Gemfile? 






To view this discussion on the web visit https://groups.google.com/d/msg/neo4jrb/-/72hMXsEJU_gJ.

Andreas Ronge

unread,
Nov 5, 2012, 7:56:20 AM11/5/12
to neo...@googlegroups.com
Looks like the Gemfile.lock is in git. It should not be checked in
(should be in .gitignore)
See,
http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/

Only the gemspec file should give the ranges of version allowed for
the devise-neo4j gem.
Try remove the Gemfile.lock from the repo.

Cheers

On Mon, Nov 5, 2012 at 1:37 PM, arikan <ari...@gmail.com> wrote:
> https://groups.google.com/d/msg/neo4jrb/-/72hMXsEJU_gJ.

Chris Fitzpatrick

unread,
Nov 5, 2012, 8:08:56 AM11/5/12
to neo...@googlegroups.com

Ah, yeah, that would make sense....I removed the .lock file from github.  Let me know if that fixes the issue.

I am thinking I ought to update this so it works with the newer version of devise and update the tests. I don't have time today, but I'll try to squeeze it in tomorrow...

Andreas Ronge

unread,
Nov 5, 2012, 8:13:40 AM11/5/12
to neo...@googlegroups.com
That's really great. Thanks a lot !

arikan

unread,
Nov 5, 2012, 8:53:31 AM11/5/12
to neo...@googlegroups.com
Thanks a lot Chris, Andreas, 

Now devise-neo4j works fine, after the Gemfile.lock update, both with Rails 3.1.7 and Rails 3.2.8, and neo4j 2.0.0 and neo4j 2.2.0.

Burak

Chris Fitzpatrick

unread,
Nov 12, 2012, 7:27:06 AM11/12/12
to neo...@googlegroups.com

Just to follow up, I made a branch of devise-neo4j that uses neo4j 2.2.0 and  devise 2.1.2. It's at https://github.com/cfitz/devise-neo4j/tree/devise2

Most of the tests pass, mostly minor problems. You can see them updates in the test/overrides folder. There is a strange issue with one of the devise tests that is checking password confirmation validation, but I cannot replicate it (that is, password confirmation works fine for me in the app and in console). 
I'll try and look into this ...  eventually.

you can try it out yourself: 
gem install rails
cd myapp
add to your Gem File : 
gem 'devise-neo4j', :git => 'git://github.com/cfitz/devise-neo4j.git', :branch => 'devise2'
bundle
rails generate devise:install --orm=neo4j
bundle exec rails g neo4j:devise User
add devise_for :users to config/routes.rb (not sure why generator is not adding this...)
rails s
go to http://localhost:3000/users/sign_up, sign up, then go to http://localhost:3000/users/ . Try and edit your password with a bad confirmation....everything works as I'd expected it to.

Otherwise, let me know what you think or if anyone sees any suggestions for improvement... b,chris. 





To view this discussion on the web visit https://groups.google.com/d/msg/neo4jrb/-/xD_hi_IJGGYJ.

Andreas Ronge

unread,
Nov 12, 2012, 10:29:10 AM11/12/12
to neo...@googlegroups.com
Great stuff, I will try to have a look at it this week

arikan

unread,
Nov 15, 2012, 5:59:05 AM11/15/12
to neo...@googlegroups.com
Hi Chris, 

I've been trying your updated gem, it works in general, but getting an error for omniauth. User is omniauthable, routes are ok, and, qhen I hit this url for twitter authentication, it throws the error below


undefined method `info' for nil:NilClass

Here is the full trace, can't see what causes the error. Any ideas?

org/jruby/RubyBasicObject.java:1673:in `__send__'
org/jruby/RubyKernel.java:2081:in `send'
omniauth (1.1.1) lib/omniauth/strategy.rb:151:in `log'
omniauth (1.1.1) lib/omniauth/strategy.rb:190:in `request_call'
omniauth (1.1.1) lib/omniauth/strategy.rb:174:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
neo4j-2.2.0 (java) lib/neo4j/rails/rack_middleware.rb:32:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `call'
org/jruby/RubyKernel.java:1173:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/cookies.rb:339:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
activesupport (3.2.8) lib/active_support/callbacks.rb:408:in `_run__2047178080__call__760364352__callbacks'
org/jruby/RubyBasicObject.java:1667:in `__send__'
org/jruby/RubyKernel.java:2077:in `send'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:390:in `_run_call_callbacks'
org/jruby/RubyBasicObject.java:1667:in `__send__'
org/jruby/RubyKernel.java:2077:in `send'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.8) lib/rails/engine.rb:479:in `call'
railties (3.2.8) lib/rails/application.rb:223:in `call'
file:jruby-rack (1.1.10) lib/jruby-rack-1.1.10.jar!/rack/handler/servlet.rb:22:in `call'

Burak

Chris Fitzpatrick

unread,
Nov 15, 2012, 6:19:35 AM11/15/12
to neo...@googlegroups.com

Hey Burak,

Looks like Omniauth is trying to add to the logger, but cannot...by default it's STDOUT.. In your config/initializers/devise.rb (outside of the Devise.setup block),  try adding :
OmniAuth.config.logger = Rails.logger

Does that fix it? 



To view this discussion on the web visit https://groups.google.com/d/msg/neo4jrb/-/b80p3upoTMcJ.

arikan

unread,
Nov 15, 2012, 10:58:01 AM11/15/12
to neo...@googlegroups.com
Hi Chris, yep it worked. Thanks a lot. So this should be added to the generator?
Reply all
Reply to author
Forward
0 new messages