Forum: Ruby on Rails rake aborted!!

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
doucie (Guest)
on 2007-02-09 23:42
OK, I've created the following migration

class CreateProducts < ActiveRecord::Migration
  def self.up
    create_table :products do |t|
      t.column :title, :string
      t.column :description, :text
      t.column :image_url, :string

  def self.down
    drop_table :products

This has created a table no problem.  I've then added another column
using the following

ruby script/generate migration add_price

This has worked.

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

  def self.down
    remove_column :products, :price

After creating the 002 migration file above and running rake db:migrate
I get a rake aborted message which says:

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.

WTF??  Help!!
This topic is locked and can not be replied to.