Topic: undefined method 'default' .... 0x3775d28

Hi All,

I get this error message and really don't know what to do...
Can anyone help me out?

Thanks,

Luc


(in C:/InstantRails-1.4-win/InstantRails/rails_apps/event)
== CreateEvents: migrating ====================================================
-- create_table(:events, {:primary_key=>:id})
-- default()
rake aborted!
undefined method `default' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x3775d00>

(See full trace by running task with --trace)
(in C:/InstantRails-1.4-win/InstantRails/rails_apps/event)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== CreateEvents: migrating ====================================================
-- create_table(:events, {:primary_key=>:id})
-- default()
rake aborted!
undefined method `default' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x3775b0c>
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:273:in `send'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:273:in `method_missing'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:257:in `say_with_time'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:257:in `say_with_time'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:271:in `method_missing'
./db/migrate//001_create_events.rb:5:in `real_up'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:94:in `create_table'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:297:in `create_table'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:273:in `send'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:273:in `method_missing'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:257:in `say_with_time'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:257:in `say_with_time'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:271:in `method_missing'
./db/migrate//001_create_events.rb:3:in `real_up'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:210:in `send'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:210:in `migrate'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:210:in `migrate'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:333:in `migrate'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:328:in `each'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:328:in `migrate'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:295:in `up'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:286:in `migrate'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/databases.rake:4
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `call'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `each'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `each'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'
C:/InstantRails-1.4-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
C:/InstantRails-1.4-win/InstantRails/ruby/bin/rake.bat:25:in `load'
C:/InstantRails-1.4-win/InstantRails/ruby/bin/rake.bat:25

Re: undefined method 'default' .... 0x3775d28

Can you post your migration file?

Railscasts - Free Ruby on Rails Screencasts

Re: undefined method 'default' .... 0x3775d28

Thanks I figured it out. I forgot the ":" in front of the default word. I wrote:
    t.column :added, :timestamp, default => Time.now
instead of
    t.column :added, :timestamp, :default => Time.now

Thanks!