Topic: Pagination doesn't work with will_paginate.

I am currently using Rails 2.3.5. I installed will_paginate gem 2.3.16
as suggested in the will_paginate github page. But will_paginate is
not being recognized when I use it and I always end up with an
error.The following are the error when used from the project console
and have also included my gem list.
--------------------------------------------------------------------------- -------
Loading development environment (Rails 2.3.5)
>> paginate_test = Product.paginate(:page=>1)

NoMethodError: undefined method `paginate' for #<Class:0x2bcee70>
        from D:/Program_Files/Ruby192/lib/ruby/gems/1.9.1/gems/
activerecord-2.3.5/lib/active_record/base.rb:1959:in `met
hod_missing'
        from (irb):1
        from D:/Program_Files/Ruby192/bin/irb:12:in `<main>'
--------------------------------------------------------------------------- -------
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.9, 2.3.5, 2.3.4)
actionpack (3.0.9, 2.3.5, 2.3.4)
activemodel (3.0.9)
activerecord (3.0.9, 2.3.5, 2.3.4)
activeresource (3.0.9, 2.3.5, 2.3.4)
activesupport (3.0.9, 2.3.5, 2.3.4)
arel (2.1.4, 2.0.10)
Ascii85 (1.0.1)
builder (2.1.2)
bundler (1.0.15)
erubis (2.6.6)
hoe (2.10.0)
mail (2.2.19)
mime-types (1.16)
minitest (1.6.0)
mysql (2.8.1 x86-mingw32)
pdf-reader (0.10.0)
polyglot (0.3.1)
prawn (0.11.1)
rack (1.2.3, 1.0.1)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (2.3.5, 2.3.4)
railties (3.0.9)
rake (0.8.7)
rdoc (3.8, 2.5.8)
sqlite3 (1.3.3 x86-mingw32)
test-unit (2.3.0, 1.2.3)
thor (0.14.6)
treetop (1.4.9)
ttfunk (1.0.1)
tzinfo (0.3.29)
will_paginate (2.3.16)
--------------------------------------------------------------------------- -------
What am I doing wrong? Should i include any more configuration? or is
there a better way of doing pagination?

Re: Pagination doesn't work with will_paginate.

do you have something like this in your environment.rb ?

Rails::Initializer.run do |config|
  config.gem 'will_paginate', :version => '~> 2.3.16'
end

You say 'project console'  but it looks like you're testing with irb

have you tried

ruby script/console

irb won't work,  because it's just a ruby console,  not a rails console,  and the rails system needs to load will_paginate and wire it up to Active Record

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.