I''ve made a model called Color to manage custom styles for my application. It works find when I''m running it locally in Mongrel, and I haven''t tried to deploy it yet. I use ZenTest and Autotest, and when I run autotest I''m getting the following message: "C:/rails/band/trunk/app/models/color.rb:1: Color is not a class (TypeError)" My Color model is very simple: class Color < ActiveRecord::Base belongs_to :setting validates_presence_of :title end I''ve run ''rake db:test:clone'' to make sure the test database is prepared. The application works normally in development mode, but it blows up in autotest. I''m not sure what''s going on. Any ideas? Thanks, Jeff --~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 2/24/08, Jeff Coleman <progressions-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''ve made a model called Color to manage custom styles for my > application. It works find when I''m running it locally in Mongrel, > and I haven''t tried to deploy it yet. > > I use ZenTest and Autotest, and when I run autotest I''m getting the > following message: > > "C:/rails/band/trunk/app/models/color.rb:1: Color is not a class > (TypeError)"This message is complaining that there''s already a constant called Color and it''s not a class. Running this simple Ruby program give the same error: Color = "Red" class Color end Now where the Color constant is being defined, I''m not sure, but I''m pretty sure that it''s not in Rails itself, my guess would be either somewhere in your own code, or in a gem or plugin you are using. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ --~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
chances it''s a naming collision rename your class and you will see On 24 фев, 22:18, Jeff Coleman <progressi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve made a model called Color to manage custom styles for my > application. It works find when I''m running it locally in Mongrel, > and I haven''t tried to deploy it yet. > > I use ZenTest and Autotest, and when I run autotest I''m getting the > following message: > > "C:/rails/band/trunk/app/models/color.rb:1: Color is not a class > (TypeError)" > > My Color model is very simple: > > class Color < ActiveRecord::Base > belongs_to :setting > > validates_presence_of :title > end > > I''ve run ''rake db:test:clone'' to make sure the test database is > prepared. The application works normally in development mode, but it > blows up in autotest. I''m not sure what''s going on. > > Any ideas? > > Thanks, > Jeff--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 24, 2:55 pm, "Rick DeNatale" <rick.denat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This message is complaining that there''s already a constant called > Color and it''s not a class.Thanks! Any ideas on why it would create a conflict in Test mode but not in Development? I''ll look through the plugins I''ve got and see if it''s defined anywhere else.> Rick DeNatale > > My blog on Rubyhttp://talklikeaduck.denhaven2.com/--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I believe it''s not environment related I bet you are using redgreen, and it has module, named Color in redgreen.rb On 24 фев, 23:06, Jeff Coleman <progressi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Feb 24, 2:55 pm, "Rick DeNatale" <rick.denat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > This message is complaining that there''s already a constant called > > Color and it''s not a class. > > Thanks! Any ideas on why it would create a conflict in Test mode but > not in Development? I''ll look through the plugins I''ve got and see if > it''s defined anywhere else.> Rick DeNatale > > > My blog on Rubyhttp://talklikeaduck.denhaven2.com/--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That would be it. It IS environment-related, in the sense that redgreen doesn''t load except in testing, so that would explain it. Woot! On Feb 24, 4:17 pm, lq <liquidaut...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I believe it''s not environment related > I bet you are using redgreen, and it has module, named Color in > redgreen.rb > > On 24 фев, 23:06, Jeff Coleman <progressi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Feb 24, 2:55 pm, "Rick DeNatale" <rick.denat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > This message is complaining that there''s already a constant called > > > Color and it''s not a class. > > > Thanks! Any ideas on why it would create a conflict in Test mode but > > not in Development? I''ll look through the plugins I''ve got and see if > > it''s defined anywhere else.> Rick DeNatale > > > > My blog on Rubyhttp://talklikeaduck.denhaven2.com/--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I edited redgreen so the Color class is in its own module, thus eliminating the conflict. Works perfectly now! On Feb 24, 5:00 pm, Jeff Coleman <progressi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That would be it. It IS environment-related, in the sense that > redgreen doesn''t load except in testing, so that would explain it. > > Woot! > > On Feb 24, 4:17 pm, lq <liquidaut...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I believe it''s not environment related > > I bet you are using redgreen, and it has module, namedColorin > > redgreen.rb > > > On 24 фев, 23:06, Jeff Coleman <progressi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On Feb 24, 2:55 pm, "Rick DeNatale" <rick.denat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > This message is complaining that there''s already a constant called > > > >Colorand it''s not a class. > > > > Thanks! Any ideas on why it would create a conflict in Test mode but > > > not in Development? I''ll look through the plugins I''ve got and see if > > > it''s defined anywhere else.> Rick DeNatale > > > > > My blog on Rubyhttp://talklikeaduck.denhaven2.com/--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---