I have some strange behaviour on Windows XP boxes (the same code on Linux doesn''t have the same behaviour). Ruby 1.8.2 and Rails 0.14.2. I have a single inheritance table nodes with a base class Node (acts_as_tree) and some subclasses such as PageNode and FolderNode. If I render the tree in an iframe in a set of iframes it doesn''t work, if I render it stand alone it works (there are three iframes with different url:s for each, nothing strange). The error is really bizarre. On some of the nodes ruby complains that "children is not a method". But it doesn''t complain on all nodes and which one differs a lot from request to request. If I do: rescue puts node.class.name puts node.kind_of? FolderNode ... it prints, for example, FolderNode on the first line and then says false on the second line (including the times when the first puts actually print FolderNode). Very strange. It feels like there is some problems with script loading. Each node subclass has it''s own file but they are all found in the /app/model dir. Is this a problem? Any ideas? Am I vague? /Marcus Various different errors gotten when just hitting refresh in the browser: - undefined method `display_name'' for #<PageNodeType:0x36acc38> - undefined method `children'' for #<PageNode:0x3761988> - undefined method `children'' for #<FolderNode:0x37ac5e0> - uninitialized constant Node (the line indicates error where FolderNode class is defined) - The single-table inheritance mechanism failed to locate the subclass: ''PageNodeType''. This error is raised because the column ''type'' is reserved for storing the class in case of inheritance. Please rename this column if you didn''t intend it to be used for storing the inheritance class or overwrite NodeType.inheritance_column to use another column for that information. - uninitialized constant FolderNode - The single-table inheritance mechanism failed to locate the subclass: ''FolderNodeType''. This error is raised because the column ''type'' is reserved for storing the class in case of inheritance. Please rename this column if you didn''t intend it to be used for storing the inheritance class or overwrite NodeType.inheritance_column to use another column for that information.
Hi ! 2005/11/1, marcus <m-lists@bristav.se>:> I have some strange behaviour on Windows XP boxes (the same code on > Linux doesn't have the same behaviour). Ruby 1.8.2 and Rails 0.14.2.I have ProductCategories in an acts_as_tree. In my case, it would complain that has_parent? did not exist. Don't ask me why it worked, but I had to add that to my class: class ProductCatalog def self.reloadable? false end end Supposedly, that prevents Rails from deleting methods from the class. Try it, and report here. I too am on WinXP. I hadn't tried on Linux, though. Might be worth a try. Bye ! François _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
marcus
2005-Nov-02 08:38 UTC
Re: Strange error(s) on windows only (probably something with threading)
Francois Beausoleil wrote: > Don''t ask me why it worked, but I had to add that to my class: > class ProductCatalog > def self.reloadable? > false > end > end > Didn''t help :( More strangeness: If I put sleep(1) first in the controller method that loads the tree it works!!!! I''ve also tried to alter the sleep length and the error comes back when the time is smaller. Why? Can''t webrick handle multiple concurrent requests? Btw, I don''t consider the problem solved since I guess it can happen again anytime, anywhere if I can''t track it down. /Marcus
Justin Forder
2005-Nov-02 09:54 UTC
Re: Strange error(s) on windows only (probably something with threading)
marcus wrote:> Francois Beausoleil wrote: > > Don''t ask me why it worked, but I had to add that to my class: > > class ProductCatalog > > def self.reloadable? > > false > > end > > end > > > > Didn''t help :( > > More strangeness: > If I put > > sleep(1) > > first in the controller method that loads the tree it works!!!! I''ve > also tried to alter the sleep length and the error comes back when the > time is smaller. > > Why? Can''t webrick handle multiple concurrent requests?WEBrick can, but (unless this has changed recently) Rails is not thread-safe and uses a mutex to serialise request processing under WEBrick. regards Justin
marcus
2005-Nov-02 12:48 UTC
Re: Strange error(s) on windows only (probably something with threading)
So this won''t be a problem if running with (F/S)CGI? /Marcus Justin Forder wrote:> marcus wrote: > >> Francois Beausoleil wrote: >> > Don''t ask me why it worked, but I had to add that to my class: >> > class ProductCatalog >> > def self.reloadable? >> > false >> > end >> > end >> > >> >> Didn''t help :( >> >> More strangeness: >> If I put >> >> sleep(1) >> >> first in the controller method that loads the tree it works!!!! I''ve >> also tried to alter the sleep length and the error comes back when the >> time is smaller. >> >> Why? Can''t webrick handle multiple concurrent requests? > > > WEBrick can, but (unless this has changed recently) Rails is not > thread-safe and uses a mutex to serialise request processing under WEBrick. > > regards > > Justin > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >
Justin Forder
2005-Nov-03 09:47 UTC
Re: Strange error(s) on windows only (probably something with threading)
marcus wrote:> So this won''t be a problem if running with (F/S)CGI?Marcus, I was just answering your question about WEBrick - and the answer would be the same for WEBrick on Linux as for WEBrick on Windows, so I don''t know the implications for your original problem. You could try InstantRails if you want to get SCGI running quickly on Windows. regards Justin> > /Marcus > > Justin Forder wrote: > >> marcus wrote: >> >>> Francois Beausoleil wrote: >>> > Don''t ask me why it worked, but I had to add that to my class: >>> > class ProductCatalog >>> > def self.reloadable? >>> > false >>> > end >>> > end >>> > >>> >>> Didn''t help :( >>> >>> More strangeness: >>> If I put >>> >>> sleep(1) >>> >>> first in the controller method that loads the tree it works!!!! I''ve >>> also tried to alter the sleep length and the error comes back when >>> the time is smaller. >>> >>> Why? Can''t webrick handle multiple concurrent requests? >> >> >> >> WEBrick can, but (unless this has changed recently) Rails is not >> thread-safe and uses a mutex to serialise request processing under >> WEBrick. >> >> regards >> >> Justin >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >