0

我正在尝试使用 neo4j-will_paginate gem 在我的 Rails 应用程序中实现分页(我使用 neo4j 作为我的数据库。)我按照https://github.com/dnagir/neo4j-will_paginate#readme上的说明进行操作。在我的 gemfile 中添加了 neo4j-will_paginate,并在我的 config/application.rb 文件中添加了“neo4j-will_paginate”。我运行了 bundle install 并试图启动 Rails,但我得到了这个错误:

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

这是我的 Gemfile 和我的 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'

这是宝石文件

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

谷歌搜索错误没有任何帮助,我还没有看到任何类似的问题,其解决方案适用于此。关于这里出了什么问题的任何想法?谢谢!

4

1 回答 1

0

这是因为 neo4j-will-paginate 的版本 < 0.1.2 不能与 neo4j.rb 版本 2+ 尝试今天发布的 0.1.2 版本。

于 2012-08-21T08:44:37.447 回答