Skip to content

Instantly share code, notes, and snippets.

@LaminSanneh
Created July 24, 2013 13:16
Show Gist options
  • Save LaminSanneh/6070486 to your computer and use it in GitHub Desktop.
Save LaminSanneh/6070486 to your computer and use it in GitHub Desktop.
Ruby on Rails : Useful Commands
Ruby on Rails Useful Commands
//Make sure you have ruby installed to be able to run these commands
gem install rails -------- This installs rails for you
gem install rails-api -------- This installs rails api gem for creating a restful api oriented app
rails new appName -------- Creates a new rails application in the
folder with the same name as the app
rails new appName -d postgresql -------- Creates a new rails application in the
folder with the same name as the app but with a parameter specifying the database type to use
rails g/generate scaffold thing thingAttribute1(type defaults to string) thingAttribute2:type(e.g. text,number) -------- Scaffolds a new type of thing in your application(make sure you cd into your app root directory)
rake db:create -------- Scans your database.yml file and creates the databases listed there
rake db:migrate -------- Creates the tables and columns after you've done a scaffold
rails s/server -------- Starts a new rails server ready to serve html files for your new app
bundle install -------- Installs the packages/bundles in you Gemfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment