This repository contains small scripts as well as instructions to read .env files in several languages.
For using it in ruby first you have to have:
Installed the ruby-dotenv gem. You can do it just by running gem install dotenv
.
For a .env
file like this:
require 'dotenv'
Dotenv.load('.env')
DB_NAME = ENV['DB_NAME']
p DB_NAME