0

我正在使用 Rails 和 Neo4j.rb 构建 REST API,我需要对一些响应进行分页。首先,我尝试使用neo4j-will_paginategem,但执行时出现以下错误bundle install

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    neo4j-will_paginate (>= 0) ruby depends on
      activesupport (~> 3.0) ruby

    devise-neo4j (~> 2.0.0.alpha.1) ruby depends on
      neo4j (>= 3.0.0.alpha.6) ruby depends on
        activesupport (4.0.0)

Bundler could not find compatible versions for gem "neo4j":
  In Gemfile:
    neo4j (~> 3.0.0) ruby

    devise-neo4j (~> 2.0.0.alpha.1) ruby depends on
      neo4j (3.0.0.alpha.6)

如何在不删除依赖项之一的情况下修复它?

除此之外,包含分页的正确方法是什么:标题或以 JSON 呈现?考虑到我将在 Ember 应用程序中使用响应,哪种方法更适合?

最好的祝福!

4

1 回答 1

2

首先,我认为您应该使用 gem 的 3.0.x 版本(而不是候选发布版),因为它已经退出 rc 有一段时间了,并且已经应用​​了许多补丁。

其次,我们制作了一个单独的 neo4j-will_paginate gem,因为我们无法访问 ruby​​gems 上的原始文件:

https://github.com/neo4jrb/neo4j-will_paginate_redux

这可能会有所帮助

于 2014-12-14T22:17:31.557 回答