diff --git a/.example-env b/.example-env index dc7f8a3e..f547b8c6 100644 --- a/.example-env +++ b/.example-env @@ -1,5 +1,3 @@ -export RAILS_ENV='development' - export DB_USERNAME='postgres' export DB_PASSWORD='3112' export DB_HOST='localhost' diff --git a/config/application.rb b/config/application.rb index 93bdb8bf..399b32c9 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,9 +1,13 @@ require File.expand_path('../boot', __FILE__) require 'rails/all' +require 'dotenv' Bundler.require(*Rails.groups) +ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" +Dotenv.load ".env.#{ENV["RAILS_ENV"]}", '.env' + module Metamaps class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here.