I just upgraded to 0.10.0 (nuked all old versions), and am getting the following error when trying to use the generator for model or controller: $ script/generate model User exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/user.rb undefined local variable or method `class_name'' for #<Rails::Generator::Commands::Create:0x3c81d990> ..... $ script/generate controller User exists app/controllers/ exists app/helpers/ create app/views/user exists test/functional/ create app/controllers/user_controller.rb undefined local variable or method `class_name'' for #<Rails::Generator::Commands::Create:0x3c81d120> Any suggestions? Seems like a bug in the generator script... Here''s the backtrace: $ ruby script/generate model User -t exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/user.rb undefined local variable or method `class_name'' for #<Rails::Generator::Commands::Create:0x3c81d4a4> (erb):1:in `template'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/commands.rb:225:in `template'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/commands.rb:222:in `file'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/commands.rb:185:in `open'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/commands.rb:185:in `file'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/commands.rb:184:in `open'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/commands.rb:184:in `file'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/commands.rb:222:in `template'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/manifest.rb:47:in `send'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/manifest.rb:47:in `send_actions'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/manifest.rb:46:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/manifest.rb:46:in `send_actions'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/manifest.rb:31:in `replay'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/commands.rb:41:in `invoke!'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/rails_generator/scripts/../scripts.rb:31:in `run'' script/generate:5 Thanks! [mp]
Mike Pilat wrote:> I just upgraded to 0.10.0 (nuked all old versions), and am getting the > following error when trying to use the generator for model or > controller:I''m having problems with the generators too , I get : C:\ruby\rails\scart>ruby script/generate controller sitecp script/generate:27: undefined method `instance'' for Rails::Generator:Module (NoMethodError) same thing when I try to generate a model any ideas anyone? thanks dylan
Stian Grytøyr
2005-Feb-25 11:26 UTC
Re: [0.10.0] scripts/generate giving error, not working
Mike Pilat <mpilat-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I just upgraded to 0.10.0 (nuked all old versions), and am getting the > following error when trying to use the generator for model or > controller: > > $ script/generate model User > exists app/models/ > exists test/unit/ > exists test/fixtures/ > create app/models/user.rb > undefined local variable or method `class_name'' for > #<Rails::Generator::Commands::Create:0x3c81d990>I''ve been getting this for quite some time with the beta gems and 0.10. Which version of Ruby are you running? I suspect it may be related to my running 1.8.1, so if you have the same version it would support the theory. -- Regards, Stian Grytøyr
David Heinemeier Hansson
2005-Feb-25 12:28 UTC
Re: [0.10.0] scripts/generate giving error, not working
> I''ve been getting this for quite some time with the beta gems and 0.10. > Which version of Ruby are you running? I suspect it may be related to > my running 1.8.1, so if you have the same version it would support the > theory.I believe that you are indeed correct. Rails is now a Ruby 1.8.2 framework. I''ve announced the good news on http://weblog.rubyonrails.com/archives/2005/02/25/rails-0100-is-a-ruby -182-framework/ -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://www.loudthinking.com/ -- Broadcasting Brain
Stian Grytøyr
2005-Feb-25 16:03 UTC
Re: [0.10.0] scripts/generate giving error, not working
David Heinemeier Hansson <david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org> wrote:> I believe that you are indeed correct. Rails is now a Ruby 1.8.2 > framework. I''ve announced the good news on > http://weblog.rubyonrails.com/archives/2005/02/25/rails-0100-is-a-ruby > -182-framework/I can confirm that an upgrade to 1.8.2 fixed the problem, at least for me. -- Regards, Stian Grytøyr
On Fri, 25 Feb 2005 17:03:23 +0100, Stian Grytøyr <sgrytoyr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> David Heinemeier Hansson <david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org> wrote: > > > I believe that you are indeed correct. Rails is now a Ruby 1.8.2 > > framework. I''ve announced the good news on > > http://weblog.rubyonrails.com/archives/2005/02/25/rails-0100-is-a-ruby > > -182-framework/ > > I can confirm that an upgrade to 1.8.2 fixed the problem, at least for me.Ah, I didn''t see that mentioned anywhere on rubyonrails.org... I am indeed running Ruby 1.8.1. I''ll upgrade tonight. Thanks all! [mp]