I''ve been facing a problem when generating a model (or controller, ...). I''m using rails 2.3.8 and ruby 1.8.7. Has anybody been facing anything like this? script/generate controller test /usr/lib/ruby/1.8/tempfile.rb:12: superclass mismatch for class Tempfile (TypeError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails_generator/commands.rb:4 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails_generator.rb:39 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/generate.rb:2 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from script/generate:3 Att. * Rodrigo Felix de Almeida* Promine Tecnologia da Informação - www.promine.com.br Project Manager Sun Certified Java Programmer -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Rodrigo Felix wrote:> I''ve been facing a problem when generating a model (or controller, ...). > I''m > using rails 2.3.8 and ruby 1.8.7. > Has anybody been facing anything like this?Do you have 2 instances of TempFile (tempfile.rb) or DelegateClass (delegate.rb) ? Googling around seems to suggest this as a problem. -- raja -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
OK, but how can I know which class is instantiating TempFile or DelegateClass? I guess it is related to some plugin, but I`m not sure. Att. * Rodrigo Felix de Almeida* Promine Tecnologia da Informação - www.promine.com.br Project Manager Sun Certified Java Programmer On Thu, Sep 23, 2010 at 1:42 AM, Raja Venkataraman <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> Rodrigo Felix wrote: > > I''ve been facing a problem when generating a model (or controller, ...). > > I''m > > using rails 2.3.8 and ruby 1.8.7. > > Has anybody been facing anything like this? > > Do you have 2 instances of TempFile (tempfile.rb) or DelegateClass > (delegate.rb) ? Googling around seems to suggest this as a problem. > > -- raja > -- > Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 found the problem. I was defining a new method content_type in the class Tempfile. *class Tempfile def content_type mime_type = IO.popen("file --brief --mime #{path}").gets unless path.blank? mime_type end end* How can I make this without breaking generators? I''ve already tried the following one (exactly how it is on the tempfile.rb), but it didn''t work: *class Tempfile < DelegateClass(File) ... end* Should I enclose it by *module SomeModuleName ... end* ? Thanks in advance. Att. * Rodrigo Felix de Almeida* Promine Tecnologia da Informação - www.promine.com.br Project Manager Sun Certified Java Programmer On Thu, Sep 23, 2010 at 10:58 AM, Rodrigo Felix < rodrigofelixdealmeida-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> OK, but how can I know which class is instantiating TempFile or > DelegateClass? I guess it is related to some plugin, but I`m not sure. > > > Att. > * > Rodrigo Felix de Almeida* > Promine Tecnologia da Informação - www.promine.com.br > Project Manager > Sun Certified Java Programmer > > > > On Thu, Sep 23, 2010 at 1:42 AM, Raja Venkataraman <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote: > >> Rodrigo Felix wrote: >> > I''ve been facing a problem when generating a model (or controller, ...). >> > I''m >> > using rails 2.3.8 and ruby 1.8.7. >> > Has anybody been facing anything like this? >> >> Do you have 2 instances of TempFile (tempfile.rb) or DelegateClass >> (delegate.rb) ? Googling around seems to suggest this as a problem. >> >> -- raja >> -- >> Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.