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.
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.
Are you actually loading the will_paginate gem (i.e. by adding it to your environment file or (if you are using bundler) by adding it to your Gemfile and running bundle install ?
Fred
I missed that part initially, then added the following in my environment.rb config.gem 'will_paginate', :version => '~> 2.3.16 and tried running rake gem:install from the project directory.But I ended up with the following error rake aborted! Don't know how to build task 'gem:install' D:/Program_Files/Ruby192/lib/ruby/1.9.1/rake.rb:1720:in `' D:/Program_Files/Ruby192/lib/ruby/1.9.1/rake.rb:2040:in `invoke_task' D:/Program_Files/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level' D:/Program_Files/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each' D:/Program_Files/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level' D:/Program_Files/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling' D:/Program_Files/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level' D:/Program_Files/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run' D:/Program_Files/Ruby192/bin/rake:31:in `<main>' But my rake -T has gem:install configured in it. I am operating behind a proxy server, is that the reason? If so what am i supposed to do?
I missed that part initially, then added the following in my environment.rb config.gem 'will_paginate', :version => '~> 2.3.16 and tried running rake gem:install from the project directory.But I ended up with the following error
If the gem is install you don't need to run gem:install. Don't know why it's failing though
Fred
Going by memory here, but don't you have to also add something to the model to let Rails know that it can be paginated?
Do you have in the model something like this:
cattr_reader :per_page @@per_page = your-per-page-value
I was trying out the tutorials from railcast (http://railscasts.com/ episodes/51-will-paginate) Nothing of that sort was mentioned...
It's been a while since I have setup anything with will_paginate but if I have it in my models it is because I followed some instructions from somewhere, probably either railscasts or the gem's documentation itself. It could be that things have changed since I used will_paginate for the last time but I am pretty sure that your model should 'know' somehow that it can be paginated.