Sam Joseph
2005-Sep-12 07:59 UTC
uninitialized constant error with search generator (sorry if this comes through twice - I had a weird problem with my mailer ...)
Hi there, I''m new to rails and ruby, although I have been programming C/Java/PHP for 15 years or so. I like what I see with ror, and I was particularly keen to get the search_generator running. However I had some problems: http://rubyforge.org/tracker/index.php?func=detail&aid=2402&group_id=657&atid=2594 I posted them as a support request to the rubyforge search_generator project a few days back, but didn''t hear anything yet, so I thought I''d try here. I did search the archive of this mailing list and the irc logs, but I didn''t find anyone with the same error as me. The main problem seems to be that simply adding the line: require_dependency "search_system" to one of my models causes an "uninitialized constant" error (attached below - plus more details on my setup in the rubyforge support request) Although I would like to try and find a fix myself I am new to ruby and rails and so I am not really sure what this error means. It seems like the Discussion class is not being properly defined, implying some kind of error with search_system.rb, since whether I try for a list or a show, I get the same sort of error. Even if you haven''t used search generator, does anybody have any ideas how to go about handling this? Many thanks in advance. CHEERS> SAM uninitialized constant Discussion /app/controllers/discussions_controller.rb:17:in `list'' Show framework trace D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/dependencies.rb:186:in `const_missing'' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:59:in `const_get'' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:59:in `constantize'' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:58:in `inject'' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:58:in `each'' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:58:in `inject'' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:58:in `constantize'' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/inflections.rb:44:in `constantize'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:169:in `paginator_and_collection_for'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:111:in `paginate'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `send'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `perform_action_without_filters'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in `perform_action_without_benchmark'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send'' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process'' D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:144:in `process_request'' D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:64:in `process!'' D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:55:in `each_cgi'' D:/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:595:in `each'' D:/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:595:in `each_cgi'' D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:55:in `process!'' D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:21:in `process!'' D:/user/Code/ruby/prometheus/public/dispatch.fcgi:24 This error occured while loading the following files: discussion.rb search_system.rb
Sam Joseph
2005-Sep-13 06:39 UTC
Re: uninitialized constant error with search generator (sorry if this comes through twice - I had a weird problem with my mailer ...)
Hmm, So I seem to have fixed this. I was trying out search generator with another app and that worked. However for some reason that second app failed to work with Apache, but worked with Brick. So I tried my first app with Brick - it ran fine - no errors. So then I ran it again with Apache, and everything worked fine. There you go. So if anyone has the same problem on apache - try running with Brick and see if that fixes it. Of course now, what I really want to do is to work out how to make search and paginate work together Many thanks. CHEERS> SAM Sam Joseph wrote:>Hi there, > >I''m new to rails and ruby, although I have been programming C/Java/PHP >for 15 years or so. >I like what I see with ror, and I was particularly keen to get the >search_generator running. However I had some problems: > >http://rubyforge.org/tracker/index.php?func=detail&aid=2402&group_id=657&atid=2594 > >I posted them as a support request to the rubyforge search_generator >project a few days back, but didn''t hear anything yet, so I thought I''d >try here. > >I did search the archive of this mailing list and the irc logs, but I >didn''t find anyone with the same error as me. > >The main problem seems to be that simply adding the line: > >require_dependency "search_system" > >to one of my models causes an "uninitialized constant" error (attached >below - plus more details on my setup in the rubyforge support request) > >Although I would like to try and find a fix myself I am new to ruby and >rails and so I am not really sure what this error means. It seems like >the Discussion class is not being properly defined, implying some kind >of error with search_system.rb, since whether I try for a list or a >show, I get the same sort of error. > >Even if you haven''t used search generator, does anybody have any ideas >how to go about handling this? > >Many thanks in advance. > >CHEERS> SAM > >uninitialized constant Discussion > >/app/controllers/discussions_controller.rb:17:in `list'' > >Show framework trace > >D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/dependencies.rb:186:in `const_missing'' >D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:59:in >`const_get'' >D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:59:in >`constantize'' >D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:58:in `inject'' >D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:58:in `each'' >D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:58:in `inject'' >D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/../../inflector.rb:58:in >`constantize'' >D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/core_ext/string/inflections.rb:44:in >`constantize'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:169:in >`paginator_and_collection_for'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:111:in `paginate'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `send'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `perform_action_without_filters'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in >`perform_action_without_benchmark'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in >`perform_action_without_rescue'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in >`perform_action_without_rescue'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send'' >D:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process'' >D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' >D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:144:in `process_request'' >D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:64:in `process!'' >D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:55:in `each_cgi'' >D:/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:595:in `each'' >D:/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:595:in `each_cgi'' >D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:55:in `process!'' >D:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:21:in `process!'' >D:/user/Code/ruby/prometheus/public/dispatch.fcgi:24 > >This error occured while loading the following files: > discussion.rb > search_system.rb > > > > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > > >