Terminal 101 Basic’s

Getting comfortable with  Terminal is extremely important for Rails development, and general administration needs.

Here are some of the common commands.

Show the logged in as user

List contents of the current directory

List contents of current directory and permissions

Change directory – go back one level

Change directory – go into directory “xyz”

Show your current path – print working directory

remove / delete a file “xyz.file”

remove / delete a folder and all of its sub contents (be careful with this one)

Create a directory – make

Create a file

copy a file

run as super user

clear screen



Basic Rails commands on Heroku

Here are some basic commands for managing a rails project on Heroku

Push a project up to Heroku

Run a DB migration

Enter into the rails console

Attach to an existing Repo

Where project is the Heroku App name. This is for use with the heroku Toolbelt.

Basic Heroku setup


First, create an account at Heroku.com

Basic commands:

Create a new repo

push you rails project to Heroku

Open your new project in a browser

View Heroku Logs

Restart you repo

The rename your repo to a more friendly name


Create a Rails project with a postgresql database

If you already have Rails setup the defaults are to create a connection for a  SQLite database.

To switch this to a PostgeSQL database.

First install a PostgreSQL database on your machine for dev and test.

For apple computers, I suggest the Postgres.app.

You also need the PG gem which connects PostgeSQL to Rails. To verify everything is ready to go, run

To create a new project with a PostgreSQL database run

This creates a new project connected postgresql

The connection settings for you new project are in the database.yml under config. Here are the default settings as of rails 4.2.4.


Common Rake Commands

create databases

run a Migration

rollback a migration

seed the database

drop the databases


Create a new Rails project with a specific version

To create a new project in rails with a specific version.

First make sure you have the rails version gem installed, then create your project.