Hi.
I’ve just started using Ruby on Rails.
Now I’ve got my first problem.
I generated a new migration ‘add_price’ and get the message:
D:\ruby\work\depot>rake
db:migrate
(in D:/ruby/work/depot)
== AddPrice: migrating
– add_column(:products, :pice, :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.[]
(See full trace by running task with --trace)
D:\ruby\work\depot>rake db:migrate --trace
(in D:/ruby/work/depot)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== AddPrice: migrating
– add_column(:products, :pice, :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.[]
d:/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' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/abstract/schema_statements.rb:122:in
add_column’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:273:in method_missing' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r b:257:in
say_with_time’
d:/ruby/lib/ruby/1.8/benchmark.rb:293:in measure' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r b:257:in
say_with_time’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:271:in method_missing' ./db/migrate//002_add_price.rb:3:in
real_up’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:210:in migrate' d:/ruby/lib/ruby/1.8/benchmark.rb:293:in
measure’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:210:in migrate' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r b:333:in
migrate’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:328:in migrate' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r b:295:in
up’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:286:in migrate' d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/databases.rake:4 d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in
execute’
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in execute' d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in
invoke’
d:/ruby/lib/ruby/1.8/thread.rb:135:in synchronize' d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in
invoke’
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in run' d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in
run’
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
d:/ruby/bin/rake.bat:25
Any idea for the reason?
Thanks,
Juergen