undefined method `will_paginate', Rails 3.1 / DataMapper

一个人想着一个人 提交于 2019-12-02 00:03:41

Don't use the :require option in the Gemfile, as you already figured out; instead require "will_paginate/data_mapper" somewhere in config/application.rb, for instance after the Bundler setup.

mliebelt

There is a similar question with an answer that indicates that auto-requiring here is the problem. See will_paginate undefined method. The Will_paginate gem appears to work though for the question and answer.

gem 'will_paginate', '~> 3.0.0', require: %w[
  will_paginate
  will_paginate/data_mapper
]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!