Command Line

I have always been fascinated about command line commands:

Rake About

Learn everything there is about your environment

rake about
About your application's environment
Ruby version              1.9.3 (x86_64-darwin11.4.2)
RubyGems version          2.0.4
Rack version              1.4
Rails version             3.2.11
JavaScript Runtime        therubyracer (V8)
Active Record version     3.2.11
Action Pack version       3.2.11
Active Resource version   3.2.11
Action Mailer version     3.2.11
Active Support version    3.2.11
Middleware                ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007f8f81a9f980>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport, Warden::Manager, ExceptionNotification::Rack
Application root          /Users/foobar/Documents/projects/rails/my_project
Environment               development
Database adapter          postgresql
Database schema version   20131220192649

Rake Assets

To compile assets, for production or wherever you may need it, you can use:

rake assets:precompile

To clean the compiled files:

rake assets:clean

Rake DB

To drop your database:

rake db:drop

To create your database:

rake db:create

To migrate all database changes or manipulations:

rake db:migrate

To create tables depending on what is in your schema.rb file:

rake db:schema:load

To run any seed date from your seed.rb file:

rake db:seed

To run rake db:create, rake db:schema:load and rake db:seed you can use:

rake db:setup

To run rake db:drop and rake db:setup you can use:

rake db:reset