Rake aborted problem

Hi all,
I know this is something probably really simple, but since I’m a noob
I’m
stuck and can’t figure it out. I’m doing the depot project/tutorial in
the
Agile Web D. with Rails. Here’s what happens, while trying to
add
the second migration, adding a missing column, I generate the migration,
002_add_price.rb, then make the changes as outlined in the book:

class AddPrice < ActiveRecord::Migration
def self.up
add_column :products, :price, :decimal, :precision=>8, :scale=>2,
:default=>0
end

def self.down
remove_column :products, :price
end
end

and then run rake db:migrate…which fails.
Here is the --trace

C:\instantrails\work\depot>rake db:migrate --trace
(in C:/instantrails/work/depot)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== AddPrice: migrating

– add_column(:products, :price, :decimal, {:precision=>8, :scale=>2,
:default=>
0})
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.[]
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4
/lib
/active_record/connection_adapters/abstract/schema_statements.rb:259:in
type_to _sql' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4 /lib /active_record/connection_adapters/abstract/schema_statements.rb:122:inadd_col
umn’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4
/lib
/active_record/migration.rb:273:in send' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4 /lib /active_record/migration.rb:273:inmethod_missing’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4
/lib
/active_record/migration.rb:257:in say_with_time' C:/instantrails/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:inmeasure’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4
/lib
/active_record/migration.rb:257:in say_with_time' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4 /lib /active_record/migration.rb:271:inmethod_missing’
./db/migrate//002_add_price.rb:3:in real_up' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4 /lib /active_record/migration.rb:210:insend’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4
/lib
/active_record/migration.rb:210:in migrate' C:/instantrails/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:inmeasure’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4
/lib
/active_record/migration.rb:210:in migrate' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4 /lib /active_record/migration.rb:333:inmigrate’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4
/lib
/active_record/migration.rb:328:in each' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4 /lib /active_record/migration.rb:328:inmigrate’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4
/lib
/active_record/migration.rb:295:in up' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4 /lib /active_record/migration.rb:286:inmigrate’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6
/lib/tasks/d
atabases.rake:4
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1
/lib/rake.rb:
387:in call' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1 /lib/rake.rb: 387:inexecute’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1
/lib/rake.rb:
387:in each' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1 /lib/rake.rb: 387:inexecute’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1
/lib/rake.rb:
357:in invoke' C:/instantrails/InstantRails/ruby/lib/ruby/1.8/thread.rb:135:insynchronize’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1
/lib/rake.rb:
350:in invoke' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1 /lib/rake.rb: 1906:inrun’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1
/lib/rake.rb:
1906:in each' C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1 /lib/rake.rb: 1906:inrun’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1
/bin/rake:7
C:/instantrails/InstantRails/ruby/bin/rake.bat:25:in `load’
C:/instantrails/InstantRails/ruby/bin/rake.bat:25

Can anyone tell me what’s happening and how you can decipher that info
from
above…so I can learn to troubleshoot on my own.

Another thing to add is that this did work, and I deleted the project
and
was trying to run through it again.

Thank you in advance for your help,
Greg


“Politicians are like diapers, both need to be changed frequently and
for
the same reasons.”

Greg P.
[email protected]

Disregard. I guess I missed updating my application to 1.2, but for the
life of me can not ever remember doing that before, though I must have
because my previous depot app worked fine…sorry to bother.

On 1/13/07, Greg P. [email protected] wrote:

class AddPrice < ActiveRecord::Migration
and then run rake db:migrate…which fails.
– add_column(:products, :price, :decimal, {:precision=>8, :scale=>2,
type_to /active_record/migration.rb:273:in send’
C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-
/lib
/active_record/migration.rb:210:in migrate' /lib /lib/tasks/d C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1 C:/instantrails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1 C:/instantrails/InstantRails/ruby/bin/rake.bat:25:in load’
Greg


“Politicians are like diapers, both need to be changed frequently and for
the same reasons.”

Greg P.
[email protected]


“Politicians are like diapers, both need to be changed frequently and
for
the same reasons.”

Greg P.
[email protected]