gem install will_paginate
try again

On Tue, Aug 24, 2010 at 11:48 AM, pravin mishra <
diatm.pravin.it.07...@gmail.com> wrote:

> Hi
>
>
> I am  using rails 2.3.8 & ruby 1.3.7 & will_paginate 2.3.14
>
> I have table name books. I am doing this code for pagination,
>
> In book_controller
>
> @@@@books = Book.paginate :page => params[:page], :per_page => 10@@@@
>
> & in index.html.erb
>
> @@@@@<%= will_paginate @books %>@@@@@
>
> Also added in environment.rb file this line
>
> @@@@@ require 'will_paginate'@@@@@
>
> After adding this when I am running “””ruby script/server””” then this
> error is coming
>
>
> @@@@@ NoMethodError in StoreController#index
>
> undefined method `paginate' for #<Class:0x4aaf448>
>
> RAILS_ROOT: C:/InstantRails-2.0-win_2/rails_apps/diligence
>
> Application Trace <http://localhost:3000/store> | Framework 
> Trace<http://localhost:3000/store>
>  | Full Trace <http://localhost:3000/store>
>
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1532:in
>  `method_missing'
>
> app/controllers/store_controller.rb:6:in `index'
>
> @@@@@
>
> When I am adding this line in environment.rb
>
> @@@config.gem 'mislav-will_paginate' , :version => '~> 2.3.14' ,
>
>   :lib => 'will_paginate' , :source => 'http://gems.github.com'@@@@
>
>
>
> then this error is coming
>
> @@@
>
>
>
> C:\InstantRails-2.0-win_2\rails_apps\diligence>ruby script/server
>
> => Booting Mongrel (use 'script/server webrick' to force WEBrick)
>
> => Rails application starting on http://0.0.0.0:3000
>
> => Call with -d to detach
>
> => Ctrl-C to shutdown server
>
> ** Starting Mongrel listening at 0.0.0.0:3000
>
> ** Starting Rails with development environment...
>
> Exiting
>
> C:/InstantRails-2.0-win_2/rails_apps/diligence/config/environment.rb:15:
> private method `gem' called for #<Rails::Configuration:0x350767c>
> (NoMethodError)
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:47:in
> `run'
>
>         from
> C:/InstantRails-2.0-win_2/rails_apps/diligence/config/environment.rb:13
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in
> `require'
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in
> `new_constants_in'
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in
> `require'
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel/rails.rb:147:in
> `rails'
>
>          ... 20 levels...
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
>
>         from
> C:/InstantRails-2.0-win_2/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
>
>         from script/server:3
>
>
>
> @@@@@
>
> Please help me
>
> thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>



-- 
Thanks:
Rajeev sharma

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to