Rake::Task['task_name'].execute
A rake task to rebuild the development database
desc 'drop, create and rebuild development db' task(:rebuild_development_db) do puts "drop the db" Rake::Task['db:drop'].execute puts "create the db" Rake::Task['db:create'].execute puts "run the migrations" Rake::Task['db:migrate'].execute # do other stuff... end
Resources