[Rails] Re: Re: newbie generate scaffold

3quid threequid at gmail.com
Wed Apr 5 07:15:09 GMT 2006


yup i know hehe.. i replied to your post! glad (sort of) to see its  
not just me!

when i add -t to the end of the scaffold command, as suggested by one  
of the guys on here get the below ... does anybody know how we can  
solve this problem? or any more people experiencing the same problem  
with this section of the book?


desktop:/users/3quid/rails/depot 3quid$ ruby script/generate scaffold  
Product Admin -t
       exists  app/controllers/
       exists  app/helpers/
       exists  app/views/admin
       exists  test/functional/
   dependency  model
       exists    app/models/
       exists    test/unit/
       exists    test/fixtures/
    identical    app/models/product.rb
    identical    test/unit/product_test.rb
    identical    test/fixtures/products.yml
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.each
   /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/ 
connection_adapters/mysql_adapter.rb:293:in `columns'
   /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/ 
base.rb:696:in `columns'
   /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/ 
base.rb:1963:in `attributes_from_column_definition'
   /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/ 
base.rb:1347:in `initialize_without_callbacks'
   /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/ 
callbacks.rb:236:in `initialize'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
generators/components/scaffold/scaffold_generator.rb:182:in `new'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
generators/components/scaffold/scaffold_generator.rb:182:in  
`model_instance'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
generators/components/scaffold/scaffold_generator.rb:164:in  
`create_sandbox'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
generators/components/scaffold/scaffold_generator.rb:85:in `manifest'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
generators/components/scaffold/scaffold_generator.rb:85:in `call'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
commands.rb:106:in `render_template_part'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
commands.rb:284:in `complex_template'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
manifest.rb:47:in `send'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
manifest.rb:47:in `send_actions'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
manifest.rb:46:in `each'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
manifest.rb:46:in `send_actions'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
manifest.rb:31:in `replay'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
commands.rb:41:in `invoke!'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/rails_generator/ 
scripts/../scripts.rb:31:in `run'
   /usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/commands/generate.rb:6
   /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in  
`require__'
   /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in  
`require'
   /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/ 
dependencies.rb:136:in `require'
   script/generate:3



Would appreciate any help that anyone can offer. I am pretty sure I  
have updated/fixed/patched ruby, ruby gems and the mysql bindings,  
unless somebody can telll from that error output that i was not  
successful with some of that?

thanks


3Quid
email - threequid at gmail.com
-----------------------------------
msn - threequid at gmail.com
aim - threequid at mac.com
-----------------------------------


On 5 Apr 2006, at 06:11:25, Chris Corwin wrote:

> i am getting the exact same error:
>
> b00ty:/Library/WebServer/Documents/Rails/depot chris$ ruby
> script/generate scaffold Product Admin
>       exists  app/controllers/
>       exists  app/helpers/
>       exists  app/views/admin
>       exists  test/functional/
>   dependency  model
>       exists    app/models/
>       exists    test/unit/
>       exists    test/fixtures/
>    identical    app/models/product.rb
>    identical    test/unit/product_test.rb
>    identical    test/fixtures/products.yml
> You have a nil object when you didn't expect it!
> You might have expected an instance of Array.
> The error occured while evaluating nil.each
> b00ty:/Library/WebServer/Documents/Rails/depot chris$
>
>
>
> also, on page 57 of the _agile_ book.
>
> i was getting a different error, before i uppt to 5.0 from 4.0 of  
> MySQL,
> as none of the "fixes" were fixing anything. =D
>
>
>
>
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060405/60d72edb/attachment-0001.html


More information about the Rails mailing list