Domanda

I'm trying to implement pagination in my Rails app with the neo4j-will_paginate gem (I'm using neo4j as my database.) I followed the instructions at https://github.com/dnagir/neo4j-will_paginate#readme viz. added neo4j-will_paginate to my gemfile and required 'neo4j-will_paginate' in my config/application.rb file. I ran bundle install and tried to fire up Rails, but I got this error:

NameError: uninitialized constant Neo4j::Traversal
  const_missing at org/jruby/RubyModule.java:2642
         (root) at /Users/--------/.rvm/gems/jruby-1.6.7/gems/neo4j-will_paginate-0.1.0/lib/neo4j-will_paginate.rb:43
        require at org/jruby/RubyKernel.java:1042
         (root) at /Users/--------/.rvm/gems/jruby-1.6.7/gems/neo4j-will_paginate-0.1.0/lib/neo4j-will_paginate.rb:12
        require at org/jruby/RubyKernel.java:1042
         (root) at /Users/--------/Documents/code/ThreeRing/threering/config/application.rb:53
            tap at org/jruby/RubyKernel.java:1787
         (root) at /Users/--------/.rvm/gems/jruby-1.6.7/gems/railties-3.2.3/lib/rails/commands.rb:50
        require at org/jruby/RubyKernel.java:1042
         (root) at script/rails:6

Here's my Gemfile and the relevent part of my config/application.rb

require File.expand_path('../boot', __FILE__)

# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
require "neo4j"
# require "will_paginate/railtie"
require 'neo4j-will_paginate'

Here's the gemfile

source 'http://rubygems.org'

gem 'rails', '3.2.3'
gem 'neo4j', '~> 2.0.0'
gem 'jruby-openssl', '~> 0.7.7'
gem 'json', '~> 1.7.3'
gem 'jquery-rails', ' ~> 2.0.2'
gem 'haml-rails', '~> 0.3.4'
gem 'bcrypt-ruby', '~> 3.0.1', :require => 'bcrypt'
# gem 'will_paginate', ' ~> 3.0.3'
gem 'neo4j-will_paginate'
gem 'carrierwave', '~> 0.6.2'
gem 'fog', '~> 1.3.1'
gem 'mini_magick', '~> 3.4'
gem 'trinidad', '~> 1.3.5', :require => nil
gem 'nokogiri'
gem 'libxml-jruby'
gem 'sanitize'

group :development do
  gem 'rspec-rails', '~> 2.10.0'
  gem 'guard-rspec', '~> 1.0.0'
end

group :test do
  gem 'factory_girl_rails', '~> 3.3.0'
  gem 'spork', ' ~> 1.0rc'
  gem 'rb-fsevent', '~> 0.9.1'

end

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.0'
  gem 'therubyrhino', '~> 1.73.4'
  gem 'uglifier', '>= 1.0.3'
end

Googling the error turns up no help, and I haven't seen any similar problems whose solutions are applicable here. Any ideas of what's going wrong here? Thanks!

È stato utile?

Soluzione

It is because version < 0.1.2 of neo4j-will-paginate does not work together with neo4j.rb version 2+ Try version 0.1.2 which was released today.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top