I am just starting out learning RoR. I am trying to follow along with the Depot project in "Agile Web Development With Rails ed2" and get the error "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.[]" I ran --trace and get the following, but I am not sure what it means. Can anyone help me make sense out of it? Thanks Mike Rensing (in /Users/mike/work/depot) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate == AddPrice: migrating =======================================================-- add_column(:products, :price, :decimal, {:default=>0, :precision=>8, :scale=>2}) rake aborted! 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.[] /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:259:in `type_to_sql'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:122:in `add_column'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:273:in `send'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:273:in `method_missing'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:257:in `say_with_time'' /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:257:in `say_with_time'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:271:in `method_missing'' ./db/migrate//002_add_price.rb:8:in `real_up'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:210:in `send'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:210:in `migrate'' /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:210:in `migrate'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:333:in `migrate'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:328:in `each'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:328:in `migrate'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:295:in `up'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:286:in `migrate'' /opt/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/databases.rake:4 /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `call'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `each'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke'' /opt/local/lib/ruby/1.8/thread.rb:135:in `synchronize'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `each'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 /opt/local/bin/rake:18:in `load'' /opt/local/bin/rake:18 -- 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-/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 11/16/06, Mike Rensing <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am just starting out learning RoR. I am trying to follow along with > the Depot project in "Agile Web Development With Rails ed2" and get the > error "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.[]" I ran --trace and get the following, but I am not sure what it > means. Can anyone help me make sense out of it? ThanksYou need to upgrade your rails version for this example to work. The decimal type isn''t supported by the current stable release. I''m sure this procedure is described somewhere close to the example. HTH, Isak --~--~---------~--~----~------------~-------~--~----~ 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 Thu, 2006-11-16 at 15:07 +0100, Mike Rensing wrote:> I am just starting out learning RoR. I am trying to follow along with > the Depot project in "Agile Web Development With Rails ed2" and get the > error "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.[]" I ran --trace and get the following, but I am not sure what it > means. Can anyone help me make sense out of it? Thanks > > Mike Rensing > > (in /Users/mike/work/depot) > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:migrate > == AddPrice: migrating > =======================================================> -- add_column(:products, :price, :decimal, {:default=>0, :precision=>8, > :scale=>2}) > rake aborted! > You have a nil object when you didn''t expect it!---- My understanding of AWDWR ed 2 is that it requires Rails 1.2 which isn''t available yet in any form other than ''edge rails'' which by default, isn''t what gets installed. I hesitated to reply because I am uncertain of the incantation required to get edge rails installed and functional Craig --~--~---------~--~----~------------~-------~--~----~ 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 Nov 16, 2006, at 7:07 AM, Mike Rensing wrote:> I am just starting out learning RoR. I am trying to follow along with > the Depot project in "Agile Web Development With Rails ed2" and get > the > error "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.[]" I ran --trace and get the following, but I am not sure > what it > means. Can anyone help me make sense out of it? ThanksThe book is written for Rails 1.2, but there seem to be some problems getting that released. In the meantime, I prepared a temporary release that helps you install Edge Rails in your application. If yo look at the second page of the PDF (the one after the cover page) you''ll find an explanation and instructions. Regards Dave Thomas
Dave Thomas wrote:> > > The book is written for Rails 1.2, but there seem to be some problems > getting that released. In the meantime, I prepared a temporary > release that helps you install Edge Rails in your application. If yo > look at the second page of the PDF (the one after the cover page) > you''ll find an explanation and instructions. > > > Regards > > > Dave ThomasThanks Dave, I ran the rake rails:update as shown on the second page, but never checked to see if it actually work. Looks like the problem was it didn''t. I did get the update to take by rails:freeze:edge and now the database updates. It is a great book so far. Thanks Mike Rensing -- 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-/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 -~----------~----~----~----~------~----~------~--~---