Skip to content

Instantly share code, notes, and snippets.

@panw
Last active July 25, 2020 02:07
Show Gist options
  • Save panw/1523e7289825583bfc45842d20914636 to your computer and use it in GitHub Desktop.
Save panw/1523e7289825583bfc45842d20914636 to your computer and use it in GitHub Desktop.
Rails Setup Notes

Creating a Rails app called my_great_app

  1. Generate a new Rails app
rails new [APP-NAME] -T -d postgresql --skip-turbolinks
  1. Make an initial commit
cd [APP-NAME]
git init
git add .
git commit -m "Initial commit. Rails boilerplate."
  1. Remove coffee script remove coffee-rails from Gemfile

Gemfile

gem 'coffee-rails'

Terminal

bundle install
git add .
git commit -m "Remove coffee-rails."
  1. Add testing Gems. Add gem rspec-rails (and faker usually) to the development, test group toward the bottom of the Gemfile.

Gemfile

group :development, :test do
  ...
  gem 'rspec-rails'
  gem 'rails-controller-testing'
  gem 'faker'
end

Terminal

bundle install
rails g rspec:install
git add .
git commit -m "Set up rspec."
  1. Create the repo on github, but not with a .gitignore since we'll be using the .gitignore from Rails.

  2. Add Github remote address

Back in your terminal inside your project folder

git remote add origin https://github.com/[ORGANIZATION]/[APP-NAME].git
git push -u origin master
  1. Start adding your own code. Happy Coding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment