undefined method `will_paginate', Rails 3.1 / DataMapper

前端 未结 3 687
长情又很酷
长情又很酷 2021-01-22 09:10

Newly installed will_paginate 3.0.0

gem \'will_paginate\', \'~> 3.0.0\', :require=>\'will_paginate/data_mapper\'

Running a controller que

相关标签:
3条回答
  • 2021-01-22 09:29

    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.

    0 讨论(0)
  • 2021-01-22 09:43
    gem 'will_paginate', '~> 3.0.0', require: %w[
      will_paginate
      will_paginate/data_mapper
    ]
    
    0 讨论(0)
  • 2021-01-22 09:48

    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.

    0 讨论(0)
提交回复
热议问题