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
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