I am just starting out learning RoR. I am trying to follow along with
the Depot project in “Agile Web D. 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 R.
(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