will_paginate: will_paginate gem does not work with padrino

my padrino app is configured as follows. The gem installs just fine, but when i run padrino i get an error. Any help will be much appreciated.

gemfile

gem ‘will_paginate’, ‘~> 3.0.pre4’

boot.rb

require ‘will_paginate’ require ‘will_paginate/active_record’

/Users/rbrigby/src/xav/config/boot.rb:9:in require': no such file to load -- will_paginate/active_record (LoadError) from /Users/rbrigby/src/xav/config/boot.rb:9:in<top (required)>’ from /Users/rbrigby/.rvm/gems/ruby-1.9.2-p290/gems/padrino-core-0.10.0/lib/padrino-core/cli/base.rb:23:in require' from /Users/rbrigby/.rvm/gems/ruby-1.9.2-p290/gems/padrino-core-0.10.0/lib/padrino-core/cli/base.rb:23:instart’ from /Users/rbrigby/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in run' from /Users/rbrigby/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:ininvoke_task’ from /Users/rbrigby/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor.rb:263:in dispatch' from /Users/rbrigby/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:instart’ from /Users/rbrigby/.rvm/gems/ruby-1.9.2-p290/gems/padrino-core-0.10.0/bin/padrino:9:in <top (required)>' from /Users/rbrigby/.rvm/gems/ruby-1.9.2-p290/bin/padrino:19:inload’ from /Users/rbrigby/.rvm/gems/ruby-1.9.2-p290/bin/padrino:19:in `<main>’

About this issue

  • Original URL
  • State: closed
  • Created 13 years ago
  • Comments: 21 (5 by maintainers)

Most upvoted comments

Where are these Padrino installation instructions? Doing what is suggested with 3.0.2 doesn’t work as described. I had to add the following to Padrino;

Padrino.before_load do
  require 'will_paginate/active_record'
  require 'will_paginate/view_helpers/sinatra'
end

to get

# app.rb
register WillPaginate::Sinatra

to work. Am I doing something wrong?

It would be good it this were better documented somewhere. will_paginate seems to be changing very rapidly between versions so I don’t think most users are expecting such a large change in implementation between minor version tags.