Skip to content

Instantly share code, notes, and snippets.

@arthurariza
Last active July 6, 2022 01:24
Show Gist options
  • Save arthurariza/ef3ac9e82c0799d1b02ca98402368f38 to your computer and use it in GitHub Desktop.
Save arthurariza/ef3ac9e82c0799d1b02ca98402368f38 to your computer and use it in GitHub Desktop.
My steps for starting a new Rails Application
  1. rails new <project_name> -d postgresql -T
  • -T, [--skip-test], [--no-skip-test] # Skip test files
  • -d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
  1. In the Gemfile: group :development, :test do gem 'factory_bot_rails' gem 'rspec-rails' gem 'shoulda-matchers' end

group :development do gem 'simplecov', require: false end

  1. Run $ bundle install rails generate rspec:install

  2. In spec/rails_helper.rb Shoulda::Matchers.configure do |config| config.integrate do |with| with.test_framework :rspec with.library :rails end end

  3. At the top of rails_helper require 'simplecov' SimpleCov.start

  4. Docker Compose File

version: '3.8'

services: db: container_name: nps_service_postgres image: postgres restart: always environment: POSTGRES_USER: root POSTGRES_PASSWORD: root POSTGRES_DB: nps_service ports: - '5432:5432' volumes: - ./tmp/postgres-data:/var/lib/postgresql/data

pgadmin: container_name: nps_service_pgadmin4_container image: dpage/pgadmin4 restart: always environment: PGADMIN_DEFAULT_EMAIL: [email protected] PGADMIN_DEFAULT_PASSWORD: root ports: - '5050:80' volumes: - ./tmp/postgres-data:/var/lib/pgadmin

volumes: postgres-data:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment