On 8月31日, 下午3時57分, Colin Law <clan...@googlemail.com> wrote: > On 31 August 2010 03:49, Jeff Chen <jeffchen1...@gmail.com> wrote: > > > > > > > On 8月30日, 下午8時19分, Colin Law <clan...@googlemail.com> wrote: > >> On 30 August 2010 10:33, Jeff Chen <jeffchen1...@gmail.com> wrote: > > >> > On 8月30日, 下午4時08分, Colin Law <clan...@googlemail.com> wrote: > >> >> ... > >> >> In particular you have not confirmed that you do not get any errors > >> >> when you start the server. > > >> > Yes, I get not any errors when start the server. > > >> >> Also please can you confirm that if you remove the calls to paginate > >> >> and just fetch all records that all works as expected. > > >> > Yes, I did remove the calls to paginate, and just fetch all records > >> > that all works as expected. > > >> >> ... > >> >> I don't see any call to paginate so that is a bit odd. Please confirm > >> >> exactly what is happening and make sure the code you post matches the > >> >> error message. Post the full error trace for the message please. > > >> > Processing ManageController#index (for 127.0.0.1 at 2010-08-30 > >> > 17:30:14) [GET] > >> > [4;35;1mSQL (64.0ms) [0m [0mSHOW TABLES [0m > >> > [4;36;1mItem Columns (403.0ms) [0m [0;1mSHOW FIELDS FROM > >> > `items` [0m > > >> > NoMethodError (undefined method `paginate' for #<Class:0x675f980>): > >> > app/controllers/manage_controller.rb:25:in `list' > > >> Right so the error is in list, that is why I asked for the whole error > >> message. > > >> > app/controllers/manage_controller.rb:4:in `index' > >> > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' > >> > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' > >> > c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' > >> > c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' > >> > c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' > >> > c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' > >> > c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' > >> > c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' > >> > c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' > >> > c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' > > >> I see that the error is from Item.paginate. You have not told us > >> anything about the Item class. Can you show us the code for that > >> class (delete methods that are not relevant before posting) and > >> confirm the path and filename to that class. > > > The item.rb of model is : > > class Item < ActiveRecord::Base > > end > > > Do I need to add the codes into the item.rb? > > No, what you have looks ok. > > Only one more suggestion I think, I seem to remember some-one having a > similar problem and it went away when they used Mongrel instead of > Webrick, though I do not understand why. I can only suggest you try > that, so start the server with > ruby script/server --mongrel
I did run: ruby script/server --mongrel , and got the result is "server : invalid option --mongrel". Where to get the mongrel, and how to fix it up when I run above command again? > and see what happens. I always use mongrel as for me it loads much faster. > > Colin -- 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.