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:inmet
hod_missing’
from (irb):1
from D:/Program_Files/Ruby192/bin/irb:12:in `’
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 `’
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 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 ?
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
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.