Debugging migrations in rails 3 using ruby-debug? -


how debug migrations using ruby-debug in rails 3?

running rake db:migrate not seem trigger debugger command in rails 2. , rake db:migrate --debugger not work either.

thanks.

i able debug migration doing following

add ruby-debug gemfile

gem 'ruby-debug19' 

in migration add require 'ruby-debug' , execute debugger in line want stop. example

require 'ruby-debug'  class createpeople < activerecord::migration    def self.up     debugger     create_table :people |t|       t.string :name       t.string :email        t.timestamps     end   end    def self.down     drop_table :people   end end 

then run rake db:migrate or other db command. example

~/dev/ruby/migrate$ rake db:migrate (in /users/augusto/dev/ruby/migrate) ==  createpeople: migrating =================================================== /users/augusto/dev/ruby/migrate/db/migrate/20110212134536_create_people.rb:7 create_table :people |t| (rdb:1) list [2, 11] in /users/augusto/dev/ruby/migrate/db/migrate/20110212134536_create_people.rb    2      3  class createpeople < activerecord::migration    4      5    def self.up    6      debugger => 7      create_table :people |t|    8        t.string :name    9        t.string :email    10      11        t.timestamps (rdb:1) 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -