GithubHelp home page GithubHelp logo

rails-env-config's Introduction

Rails Env Config

This gem provides support for importing local environment variables. With the advent of platform hosting services, the convention is now to store configuration in system environment variables which applications access using ENV.

This is great when you have a platform which sets these for you automatically but not so good in development.

This gem allows you to define environment variables in a config/environment.yml file and these will then be loaded into ENV each time your application starts.

Installation

Enabling this is easy, just add it to your Gemfile and run bundle.

gem 'rails_env_config', '~> 1.0'

Once installed, you can create a yaml file containing your local environment variables.

# Some Viaduct keys go here
VIADUCT_OAUTH_KEY: abc123abc123abc123
VIAUDCT_OAUTH_SECRET: sadfjhu4hdjuhsdufghduih

# Rails session secrets
SECRET_KEY_BASE: 4fba605ff1f4c8d35d49feb5ebe0cea28dd27f40e104e46e85c1c408a28c730d83c31d77e4691c3dc4e841480ab72c9b143415deb86c6fac164b1a72eb9e1205

Be sure that you don't commit this file into your repository. It should only be used for setting configuration for development use.

echo 'config/environment.yml' >> .gitignore

That's it!

Simple, huh?

rails-env-config's People

Contributors

adamcooke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

catphish nnhansg

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.