ruby-console
rake -h - help
rake -T - task
db:create creates the database for the current env
db:create:all creates the databases for all envs
db:drop drops the database for the current env
db:drop:all drops the databases for all envs
db:migrate runs migrations for the current env that have not run yet
db:migrate:up runs one specific migration
db:migrate:down rolls back one specific migration
db:migrate:status shows current migration status
db:rollback rolls back the last migration
db:forward advances the current schema version to the next one
db:seed (only) runs the db/seed.rb file
db:schema:load loads the schema into the current env's database
db:schema:dump dumps the current env's schema (and seems to create the db as well)
db:setup runs db:schema:load, db:seed
db:reset runs db:drop db:setup
db:migrate:redo runs (db:migrate:down db:migrate:up) or (db:rollback db:migrate:migrate) depending on the specified migration
db:migrate:reset runs db:drop db:create db:migrate
ruby -v - ruby version
clear - clear everything
ruby hello.rb - run program hello.rb
rails server - run server
control c - exiting server
cd desktop - got to folder
cd .. - go up on folder
kill port server
run
lsof -i tcp:3000
look for the PID and run (PID = 42781)
kill -9 42781
ruby generate h- - generate help
Create a new controller
rails g controller site home
it creates a new controller class site with def home
rails s -p 4000 check the app on the port 4000