Git Product home page Git Product logo

rails-boilerplate's Introduction

Rails Skeleton

A skeleton proposal to Ruby on Rails applications.

In this skeleton we have:

  • Ruby on Rails 5
    • Latest Ruby on Rails
  • TypeScript
    • TypeScript is used instead of CoffeeScript (configured and ready to use)
  • HTML5 Boilerplate
    • best practices already included
  • A great improvement in the application.html.erb (with the option to overrides several sections of the page and not the body only)
  • Auto-reloading techniques with livereload, guard and guard-livereload

Installation

Simple Installation

Detailed Installation

If you have Ruby, Rails, NPM and NodeJS already installed you probably can jump to the next section.

Install Latest Ruby

If you don't have the latest ruby yet you can install it using rvm. The official documentation is here.

  • Add rvm keys:
    • gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
  • Install rvm:
  • Install the latest ruby:
    • rvm install ruby --latest

Install Latest Rails

If you don't have rails yet you can install it as follows:

  • gem install rails

Update All Gems

If would like to update all your gems first you can do it as follows:

  • gem update

Install NodeJS

If you don't have NodeJS and NPM installed yet you can follow these instructions in the official documentation.

Install Latest NPM

If you already have npm installed and you would like update it to the latest version you can do it as follows:

  • npm install npm@latest -g

Install Latest NodeJS

If you already have npm installed and you would like to update the NodeJS to the latest version you can do it as follows:

  • sudo npm cache clean -f
  • sudo npm install -g n
  • sudo n stable

Important! The option -f is used to force clean the npm cache. Take care about it. Anyway, I usually do this when I would like to install the latest NodeJS.

Install NPM Dependencies:

These instructions is used to install the local npm dependencies. The dependencies will be placed in the node_modules folder (already ignored by .gititnore).

  • npm install

Install Some Global NPM Dependencies:

If you would like to have the typescript dependencies installed globally you can do this as follows:

  • npm install -g @types/node typescript
    • Maybe sudo is needed to run the previous command.

Update All Global NPM Dependencies:

  • npm update -g
    • Maybe sudo is needed to run the previous command.

Usage

Development Mode

  • bin/rake db:migrate
  • guard
    • Run this command in one terminal (this enable the capability to auto-reload the browser when have have file changes)
  • bin/rails server
    • Run this in another terminal

Production Mode

  • RAILS_ENV=production bin/rake db:migrate
  • RAILS_ENV=production bin/rake secret
  • This secret will be used in the following steps.
  • RAILS_ENV=production bin/rake assets:clean
  • RAILS_ENV=production bin/rake assets:precompile
  • RAILS_ENV=production RAILS_SERVE_STATIC_FILES=true SECRET_KEY_BASE={secret key} bin/rails server

rails-boilerplate's People

Contributors

danilo-araujo-silva avatar garoudan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.