Skip to content

Instantly share code, notes, and snippets.

@stevenwanderski
Last active July 9, 2020 12:50
Show Gist options
  • Save stevenwanderski/860bfb3e48e3b082195fe8c59253d781 to your computer and use it in GitHub Desktop.
Save stevenwanderski/860bfb3e48e3b082195fe8c59253d781 to your computer and use it in GitHub Desktop.
Fresh Rails Install

Fresh Rails Install

Follow these steps to get a fully functioning Rails app up and running complete with initial styles and authentication.

  1. Install Rails with Postgres: rails new trix -d postgresql --skip-action-cable --skip-coffee --skip-turbolinks --skip-test

  2. Create database: rake db:create

  3. Create UUID migration and run it: rails g migration enable_uuid_extension Add this line: enable_extension 'pgcrypto'

  4. Create config/initializers/generators.rb and add:

    Rails.application.config.generators do |g|
      g.orm :active_record, primary_key_type: :uuid
    end
  5. Add libraries to Gemfile and run bundle:

    gem 'devise'
    gem 'awesome_print'
    gem 'annotate'
    gem 'active_link_to'
  6. Install Devise: rails generate devise:install

  7. Create a User model and run migration: rails generate devise User

  8. Install Webpacker: rails webpacker:install

  9. SASS: Change /assets/stylesheets/application.css to .scss and the following:

    @import 'variables';
    @import 'base';
    @import 'button';
    @import 'form';
    @import 'auth';
  10. Add fonts to /views/layouts/application.html.erb:

  <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Paytone+One:400,600,700,800&display=swap" rel="stylesheet">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment