Avatar Edgar Gonzalez

  • Random
  • Archive
  • RSS

How to list all Rails 3 rake tasks

If you run the “classic” rake -T, only the tasks with descriptions will be appear, for instance:

$ rake -T db

Will display something like:

rake db:create          # Create the database from config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config)
rake db:drop            # Drops the database for the current Rails.env (use db:drop:all to drop all databases)
rake db:fixtures:load   # Load fixtures into the current environment's database.
rake db:migrate         # Migrate the database (options: VERSION=x, VERBOSE=false).
rake db:migrate:status  # Display status of migrations
rake db:rollback        # Rolls the schema back to the previous version (specify steps w/ STEP=n).
rake db:schema:dump     # Create a db/schema.rb file that can be portably used against any DB supported by AR
rake db:schema:load     # Load a schema.rb file into the database
rake db:seed            # Load the seed data from db/seeds.rb
rake db:setup           # Create the database, load the schema, and initialize with the seed data (use db:reset to also drop the db first)
rake db:structure:dump  # Dump the database structure to db/structure.sql. Specify another file with DB_STRUCTURE=db/my_structure.sql
rake db:version         # Retrieves the current schema version number

But the rake task db:test:prepareĀ is not listed. If you want to list all the tasks, no matter if have a description or not, use this:

$ rake -P

And if you want to avoid the noise, use the following to show the names of all Rake tasks:

$ rake -P | grep rake
    • #rails
    • #rails3
    • #rake
  • 9 months ago
  • 2
  • Comments
  • Permalink
  • Share
    Tweet

2 Notes/ Hide

  1. edgar posted this

Recent comments

Blog comments powered by Disqus
← Previous • Next →

Portrait/Logo

About

Edgar Gonzalez

Father, husband, and software developer. I'm building web applications since 1994 for a living and I love it.

Rubyist, Rails developer since 2006, believer of Agile Development and Lean startups, NoSQL enthusiast.

Born in Caracas - Venezuela, living in New York.

Me, Elsewhere

  • @edgar on Twitter
  • Facebook Profile
  • edgargonzaleznetve on Youtube
  • egg on Flickr
  • edgar on Foursquare
  • My Skype Info
  • Linkedin Profile
  • edgar on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr