Re: require_gem is obsolete

Guest
Mon, 05 Feb 2007 14:03:49 -0000

Steve Longdo wrote:
> run rake with the -t option to get a stack trace.( rake -t db:migrate )
> Check your database.yml, that can be a source of silent failure with the
> db:migrate task.
>
I experimented a bit with this - here is what it looks like.

rake crashes command prompt anytime - first I thought that it happens
when there is an error. However, it happens EVERY time rake is run.
Below is the result of a successful rake -t db:migrate (piped to a file
- the only way to get the output). After it finishes, command shell
disappears.

(in D:/ruby/shekn)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== CreateUsers: migrating
====================================================-- create_table(:users_test)
   -> 0.1500s
== CreateUsers: migrated (0.1500s)
===========================================
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump

Here is a trace when rake is aborted - but it does not matter if it
successful or not - command prompt gone every time no matter what.

(in D:/ruby/shekn)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== CreateUsers: migrating
====================================================-- create_table(:users)
rake aborted!
Mysql::Error: #42S01Table ''users'' already exists: CREATE TABLE
users
(`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name`
varchar(255) DEFAULT NULL, `hashed_password` varchar(255) DEFAULT NULL,
`salt` varchar(255) DEFAULT NULL) ENGINE=InnoDB
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/connection_adapters/abstract_adapter.rb:128:in
`log''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/connection_adapters/mysql_adapter.rb:243:in
`execute''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:104:in
`create_table''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/connection_adapters/mysql_adapter.rb:353:in
`create_table''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:275:in
`send''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:275:in
`method_missing''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:259: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.15.1/lib/active_record/migration.rb:259:in
`say_with_time''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:273:in
`method_missing''
./db/migrate//001_create_users.rb:3:in `real_up''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:212:in
`send''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:212:in
`migrate''
D:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:212:in
`migrate''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:335:in
`migrate''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:330:in
`each''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:330:in
`migrate''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:297:in
`up''
D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:288:in
`migrate''
D:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/tasks/databases.rake:4
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `call''
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 `each''
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 `each''
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:in `load''
D:/ruby/bin/rake.bat:25

Serge

--
Posted via http://www.ruby-forum.com/.