Skip to content

alfredlam42/intro-to-dotenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Introduction and Setup of dotenv

What Is It And What Does It Do?

dotenv is a ruby gem that allows you to use the .env file to store environment variables. Think of it as a global variable for your entire app.

Why Should I Use dotenv?

Aside from the obvious reason of having a global variable, most people use the .env file to store private information like API keys. And usually, the .env file is included in the .gitignore file so that you don't accidentally upload it to your repository.

Setting Up dotenv

In your gemfile:

gem 'dotenv'

and in your /config/environment.rb file:

require 'dotenv'
Dotenv.load

Additional Resources

.gitignore files

dotenv Repo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published